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)

public class HttpSessionStateContainer : IHttpSessionState
public class HttpSessionStateContainer implements IHttpSessionState
public class HttpSessionStateContainer implements IHttpSessionState
Not applicable.

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.


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

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

© 2016 Microsoft