This documentation is archived and is not being maintained.

HttpSessionStateWrapper Class

Encapsulates the HTTP intrinsic object that provides access to session-state values, session-level settings, and lifetime management methods.


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

public class HttpSessionStateWrapper : HttpSessionStateBase

The HttpSessionStateWrapper type exposes the following members.

Public methodHttpSessionStateWrapperInitializes a new instance of the HttpSessionStateWrapper class.

Public propertyCodePageGets or sets the character-set identifier for the current session. (Overrides HttpSessionStateBase.CodePage.)
Public propertyContentsGets a reference to the current session-state object. (Overrides HttpSessionStateBase.Contents.)
Public propertyCookieModeGets a value that indicates whether the application is configured for cookieless sessions. (Overrides HttpSessionStateBase.CookieMode.)
Public propertyCountGets the number of items in the session-state collection. (Overrides HttpSessionStateBase.Count.)
Public propertyIsCookielessGets a value that indicates whether the session ID is embedded in the URL. (Overrides HttpSessionStateBase.IsCookieless.)
Public propertyIsNewSessionGets a value that indicates whether the session was created during the current request. (Overrides HttpSessionStateBase.IsNewSession.)
Public propertyIsReadOnlyGets a value that indicates whether the session is read-only. (Overrides HttpSessionStateBase.IsReadOnly.)
Public propertyIsSynchronizedGets a value that indicates whether access to the collection of session-state values is synchronized (thread safe). (Overrides HttpSessionStateBase.IsSynchronized.)
Public propertyItem[Int32]Gets or sets a session value by using the specified index. (Overrides HttpSessionStateBase.Item[Int32].)
Public propertyItem[String]Gets or sets a session value by using the specified name. (Overrides HttpSessionStateBase.Item[String].)
Public propertyKeysGets a collection of the keys for all values that are stored in the session-state collection. (Overrides HttpSessionStateBase.Keys.)
Public propertyLCIDGets or sets the locale identifier (LCID) of the current session. (Overrides HttpSessionStateBase.LCID.)
Public propertyModeGets the current session-state mode. (Overrides HttpSessionStateBase.Mode.)
Public propertySessionIDGets the unique identifier for the session. (Overrides HttpSessionStateBase.SessionID.)
Public propertyStaticObjectsGets a collection of objects that are declared by object elements that are marked as server controls and scoped to the current session in the application's Global.asax file. (Overrides HttpSessionStateBase.StaticObjects.)
Public propertySyncRootGets an object that can be used to synchronize access to the collection of session-state values. (Overrides HttpSessionStateBase.SyncRoot.)
Public propertyTimeoutGets or sets the time, in minutes, that can elapse between requests before the session-state provider ends the session. (Overrides HttpSessionStateBase.Timeout.)

Public methodAbandonCancels the current session. (Overrides HttpSessionStateBase.Abandon().)
Public methodAddAdds an item to the session-state collection. (Overrides HttpSessionStateBase.Add(String, Object).)
Public methodClearRemoves all keys and values from the session-state collection. (Overrides HttpSessionStateBase.Clear().)
Public methodCopyToCopies the collection of session-state values to a one-dimensional array, starting at the specified index in the array. (Overrides HttpSessionStateBase.CopyTo(Array, Int32).)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator that can be used to read all the session-state variable names in the current session. (Overrides HttpSessionStateBase.GetEnumerator().)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemoveDeletes an item from the session-state collection. (Overrides HttpSessionStateBase.Remove(String).)
Public methodRemoveAllRemoves all keys and values from the session-state collection. (Overrides HttpSessionStateBase.RemoveAll().)
Public methodRemoveAtDeletes the item at the specified index from the session-state collection. (Overrides HttpSessionStateBase.RemoveAt(Int32).)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

The HttpSessionStateWrapper class derives from the HttpSessionStateBase class and serves as a wrapper for the HttpSessionState class. This class exposes the functionality of the HttpSessionState class and exposes the HttpSessionStateBase type. The HttpSessionStateBase class lets you replace the original implementation of the HttpSessionState class in your application with a custom implementation, such as when you perform unit testing outside the ASP.NET pipeline.

.NET Framework

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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