The session ID should remain the same for the same visitor in the same connection. If the session ID changes between pages, It will likely to break your application especially if you are using session ID to improve your ViewState complexity. An example to this usage:
Page.ViewStateUserKey = Session.SessionID;
Response.Cookies.Add(new HttpCookie("id", ""))
objManageSession.CreateSessionID(this.Context);
Global.asax
:protected void Session_Start(object sender, EventArgs e)
{
// It adds an entry to the Session object so the sessionID is kept for the entire session
Session["init"] = "session start";
}
Page_Load
method of your homepage:protected void Page_Load(object sender, EventArgs e){ Session["init"] = "session start";}
In your web.config file, change the value of httpOnlyCookies
and requireSSL
parameters to false
. If they are set to true
, the local server will force the application to regenerate session between pages. Make sure to switch these values back to true before you migrate your code to the server.
<httpCookies httpOnlyCookies="false" requireSSL="false"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.