Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP Session Object

ASP Session Object


The Session object is used to store information about a user session, or to change the settings of a user session.


Session Object

When you work with an application on your computer, you open it, make some changes, and then close it. This is much like a conversation (Session). The computer knows who you are. It knows when you open and close the application. However, on the Internet a problem arises: because HTTP addresses cannot maintain state, the web server does not know who you are or what you have done.

ASP solves this problem by creating a unique cookie for each user. The cookie is sent to the user's computer and contains information that identifies the user. This interface is called the Session object.

The Session object is used to store information about a user session, or to change the settings of a user session.

Variables stored in the Session object hold information for a single user and are available to all pages in an application. Common information stored in session variables is typically name, id, and parameters. The server creates a new Session for each new user and destroys the Session object when the session expires.


When does a session start?

A session starts when: