HttpSessionStateContainer HttpSessionStateContainer HttpSessionStateContainer HttpSessionStateContainer Class

Definition

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

public ref class HttpSessionStateContainer : System::Web::SessionState::IHttpSessionState
public class HttpSessionStateContainer : System.Web.SessionState.IHttpSessionState
type HttpSessionStateContainer = class
    interface IHttpSessionState
Public Class HttpSessionStateContainer
Implements IHttpSessionState
Inheritance
HttpSessionStateContainerHttpSessionStateContainerHttpSessionStateContainerHttpSessionStateContainer
Implements

Examples

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.

Remarks

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.

Constructors

HttpSessionStateContainer(String, ISessionStateItemCollection, HttpStaticObjectsCollection, Int32, Boolean, HttpCookieMode, SessionStateMode, Boolean) HttpSessionStateContainer(String, ISessionStateItemCollection, HttpStaticObjectsCollection, Int32, Boolean, HttpCookieMode, SessionStateMode, Boolean) HttpSessionStateContainer(String, ISessionStateItemCollection, HttpStaticObjectsCollection, Int32, Boolean, HttpCookieMode, SessionStateMode, Boolean) HttpSessionStateContainer(String, ISessionStateItemCollection, HttpStaticObjectsCollection, Int32, Boolean, HttpCookieMode, SessionStateMode, Boolean)

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

Properties

CodePage CodePage CodePage CodePage

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

CookieMode CookieMode CookieMode CookieMode

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

Count Count Count Count

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

IsAbandoned IsAbandoned IsAbandoned IsAbandoned

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

IsCookieless IsCookieless IsCookieless IsCookieless

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

IsNewSession IsNewSession IsNewSession IsNewSession

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

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

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

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

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

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Gets or sets a session value by numerical index.

Item[String] Item[String] Item[String] Item[String]

Gets or sets a session value by name.

Keys Keys Keys Keys

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

LCID LCID LCID LCID

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

Mode Mode Mode Mode

Gets the current session-state mode.

SessionID SessionID SessionID SessionID

Gets the unique identifier for the session.

StaticObjects StaticObjects StaticObjects StaticObjects

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

SyncRoot SyncRoot SyncRoot SyncRoot

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

Timeout Timeout Timeout Timeout

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

Methods

Abandon() Abandon() Abandon() Abandon()

Marks the current session as abandoned.

Add(String, Object) Add(String, Object) Add(String, Object) Add(String, Object)

Adds a new item to the session-state collection.

Clear() Clear() Clear() Clear()

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

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

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

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(String) Remove(String) Remove(String) Remove(String)

Deletes an item from the session-state collection.

RemoveAll() RemoveAll() RemoveAll() RemoveAll()

Clears all session-state values.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

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

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also