Sessions
Session state allows you to store information for a particular visitor session in between requests. An example of a session is a visitor browsing your site. Session state lets you store information relevant to the session via a dictionary-type syntax:
Session["book"] = "ASP.NET Site Performance";
Retrieval is just as easy:
string bookName = (string)Session["book"];
In the default InProc mode, the session state information is stored in memory. That's fast, but won't work if you use multiple web servers, because the next request from the same visitor may go to another server. The StateServer and SQL Server modes cater to server farms by storing session state on a central server or database. If the mode is set to something ...
Get ASP.NET Site Performance Secrets now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.