need to set the secure flag for session cookies.
I have tried like below but session will null, displays Session Expired. Please login again.
<httpCookies requireSSL="true" />
i'm setting secure flag for cookie as like above code in <system.web>
cs page code:
protected void Page_Load(object sender, EventArgs e)
{
if (Request.ServerVariables["HTTP_REFERER"] != null)
{
if (Request.Form["mwa"] != null && Request.Form["mwp"] != null)
{
String EmployeeNo = Request.Form["mwa"];
String ApplicationID = Request.Form["mwp"];
TripleDESSecureAlgorithm.CipherCode objTripleDes = new TripleDESSecureAlgorithm.CipherCode();
String strEmpNumbDec = objTripleDes.Decrypt(EmployeeNo, ApplicationID);
if (strEmpNumbDec != "")
{
Session["EMPID"] = strEmpNumbDec;
}
}
if (HttpContext.Current.Session["EMPID"] == null)
{
Response.Write("<center>Session Expired. Please login again.</center>");
Response.End();
}
and
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
in <system.web>
Please help me in this case why current session is null.? or any other way to implement this ?
What I have tried:
I have tried like below but session will null, displays Session Expired. Please login again.
<httpCookies requireSSL="true" />