ASP.NET provides you with a method of storing data per session. A session is related to the current user at the present time. When it operates correctly, a session will span multiple requests for the same user. This is very useful for example for allowing a user to login and storing their user ID in a session variable (although ASP.NET has other mechanisms for maintaining site logins, I am using this as an example). There are several factors to consider when using sessions: -
- How will ASP.NET maintain the session across multiple requests (how does it know that different requests come from the same user)?
- How will the session variables be stored on the server?
- How long does a session last?
There are probably other factors, but these are generally the most important ones in my experience. Each of these factors can be controlled from the configuration/sessionstate element in web.config. I will go into more detail about this in future posts. Before that, I will explain how to access the session variables at all.
- ASP.NET Sessions Part 1
- ASP.NET Sessions Part 2 - accessing session state variable data
- ASP.NET Sessions Part 3 - Maintaining the Session Data Across Multiple Requests
- ASP.NET Sessions Part 4 - Configuring how the Session Variable Data is Stored on the Server
- ASP.NET Sessions Part 5 - How Long Does a Session Last?
- ASP.NET Sessions Part 6 - Abandoning a Session
No related posts.
Tags: .NET, ASP.NET, ASP.NET Sessions, Session, Sessions, SessionState, State











