O'Reilly logo

ASP.NET Developer's JumpStart by Ken Getz, Paul D. Sheriff

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

Using the Session Object

The ViewState information is great for maintaining state across postbacks on a single page, but as you develop Web applications in .NET, you will find that there is a definite need to keep track of data from one page to another, not just on a single page. That's when you need a Session object.

Each time a new user comes into your site, IIS creates a new Session object. IIS automatically assigns a unique number to this session and places it into the Session object's SessionID property. You can use this SessionID to uniquely identify a particular user and create your own session variables to hold state as long as that user's session is active. IIS sends the value of the SessionID property to the browser as a dynamic cookie; ...

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