ASP.NET: Session.SessionID changes between requests
问题 Why does the property SessionID on the Session -object in an ASP.NET-page change between requests? I have a page like this: ... <div> SessionID: <%= SessionID %> </div> ... And the output keeps changing every time I hit F5, independent of browser. 回答1: This is the reason When using cookie-based session state, ASP.NET does not allocate storage for session data until the Session object is used. As a result, a new session ID is generated for each page request until the session object is accessed