开发者

.Net SessionID is changing on every request

开发者 https://www.devze.com 2023-04-11 12:18 出处:网络
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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号