Maintaining State with the Session Object

The Session object provides a mechanism that allows data to be stored on a per-client basis. Before delving into how to use the Session object, you need to understand the concept of a session state.

ASP.NET Session State

What is a session? A session is a period of time during which a unique user interacts with a Web Server. Session state is the ability to retain data for this unique user during the session.

The Session object is very similar to a hash table, in that it stores data in key-value pairs. Data stored in the Session object can be retrieved for a predetermined amount of time.

The following is the syntax used to store data in the Session object:

Session("Key") = Value

The following is the syntax ...

Get Creating and Consuming Web Services in Visual Basic® 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.