O'Reilly logo

ASP.NET Site Performance Secrets by Matt Perdeck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required