What is the ASP session object?

The Active Server Pages (ASP) module includes different types of objects, including the ASP session object. This object stores information about user sessions.

A session object contains information about a single user; this information is available across the pages of an application.

The session object has certain methods, collections, properties, and events associated with it, which are described below.

Methods

  • Contents.Remove: Deletes an item from the Contents Collection.

  • Contents.RemoveAll(): Deletes all items from the Contents Collection.

  • Abandon: Destroys the user session by getting rid of the Session object and any resources allocated to it.

Collections

  • StaticObjects: Contains all the objects appended to the session with an HTML tag.

  • Contents: Contains all the objects appended to the session with a script command.

Properties

  • SessionID: Returns a unique ID for each user. The server generates the ID.

  • TimeOut: Sets or returns the timeout period (in minutes) for the Session object.

  • CodePage: Specifies the character set that is used when displaying dynamic content.

  • LCID: This property takes an integer argument to specify a region based on which dates, time, and currency are formatted.

Events

  • Session_OnStart: Occurs when a session is initiated by the server.

  • Session_OnEnd: Occurs when a session ends by either a timeout or a user ending it.

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved