.Net SessionID is changing on every request
I want to save basket data into the session, but I've found that the session is not persisting. When I debugged the session, I realized that SessionID changes between requests.
I have the following on my mast开发者_如何转开发er page:
protected override void OnInit(EventArgs e) {
base.OnInit(e);
Session["B2C_Session"] = true;
}
Why would this happen? What causes it and what can I do to fix it? I am using .net 3.5.
By default ASP.NET applications store session id's in a cookie. If the client is refusing that cookie, then the session id won't be stored so you won't have a way to tie that client to a specific session.
Ensure that the client is accepting the cookie so the session can be persisted.
精彩评论