HttpSessionStateContainer Class

HttpSessionStateContainer Class

 

Contains session-state values as well as session-level settings for the current request.

Namespace:   System.Web.SessionState
Assembly:  System.Web (in System.Web.dll)

System.Object
  System.Web.SessionState.HttpSessionStateContainer

public class HttpSessionStateContainer : IHttpSessionState

NameDescription
System_CAPS_pubmethodHttpSessionStateContainer(String, ISessionStateItemCollection, HttpStaticObjectsCollection, Int32, Boolean, HttpCookieMode, SessionStateMode, Boolean)

Creates a new HttpSessionStateContainer object and initializes it with the specified settings and values.

NameDescription
System_CAPS_pubpropertyCodePage

Gets or sets the character-set identifier for the current session.

System_CAPS_pubpropertyCookieMode

Gets a value that indicates whether the application is configured for cookieless sessions.

System_CAPS_pubpropertyCount

Gets the number of items in the session-state collection.

System_CAPS_pubpropertyIsAbandoned

Gets a value indicating whether the current session has been abandoned.

System_CAPS_pubpropertyIsCookieless

Gets a value indicating whether the session ID is embedded in the URL or stored in an HTTP cookie.

System_CAPS_pubpropertyIsNewSession

Gets a value indicating whether the session was created with the current request.

System_CAPS_pubpropertyIsReadOnly

Gets a value indicating whether the session is read-only.

System_CAPS_pubpropertyIsSynchronized

Gets a value indicating whether access to the collection of session-state values is synchronized (thread safe).

System_CAPS_pubpropertyItem[Int32]

Gets or sets a session value by numerical index.

System_CAPS_pubpropertyItem[String]

Gets or sets a session value by name.

System_CAPS_pubpropertyKeys

Gets a collection of the keys for all values stored in the session-state collection.

System_CAPS_pubpropertyLCID

Gets or sets the locale identifier (LCID) of the current session.

System_CAPS_pubpropertyMode

Gets the current session-state mode.

System_CAPS_pubpropertySessionID

Gets the unique identifier for the session.

System_CAPS_pubpropertyStaticObjects

Gets a collection of objects declared by <object Runat="Server" Scope="Session"/> tags within the ASP.NET application file Global.asax.

System_CAPS_pubpropertySyncRoot

Gets an object that can be used to synchronize access to the collection of session-state values.

System_CAPS_pubpropertyTimeout

Gets and sets the amount of time, in minutes, allowed between requests before the session-state provider terminates the session.

NameDescription
System_CAPS_pubmethodAbandon()

Marks the current session as abandoned.

System_CAPS_pubmethodAdd(String, Object)

Adds a new item to the session-state collection.

System_CAPS_pubmethodClear()

Removes all values and keys from the session-state collection.

System_CAPS_pubmethodCopyTo(Array, Int32)

Copies the collection of session-state values to a one-dimensional array, starting at the specified index in the array.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that can be used to read all the session-state variable names in the current session.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodRemove(String)

Deletes an item from the session-state collection.

System_CAPS_pubmethodRemoveAll()

Clears all session-state values.

System_CAPS_pubmethodRemoveAt(Int32)

Deletes an item at a specified index from the session-state collection.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

ASP.NET provides session-state management to enable you to store information associated with a unique browser session across multiple requests. You can store a collection of values referenced by a key name or by numerical index. Access to session values and functionality is available using the HttpSessionState class, which is accessible through the Session property of the current HttpContext or the Session property of the Page. The HttpSessionState class accesses session-state values and session-level settings by referencing a session-state container, which is an implementation of the IHttpSessionState interface that has been populated with session-state data and added to the HttpContext of the current request by the session-state module for the HttpApplication.

The HttpSessionState class calls the HttpSessionStateContainer class, which manages session settings and values in memory.

The HttpSessionStateContainer class is the ASP.NET implementation of the IHttpSessionState interface. The HttpSessionStateContainer class is not intended to be called from application code. If you replace the SessionStateModule with a custom session-state module, you can use the HttpSessionStateContainer class, or supply your own implementation of the IHttpSessionState interface.

For an example of a custom session-state module that uses the HttpSessionStateContainer class as the session-state container for the current request, see the SessionStateUtility class overview.

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft