System.Web.SessionState.SessionStateUtility.GetHttpSessionStateFromContext Method

Retrieves session data from the context for the current request.

Syntax

public static IHttpSessionState GetHttpSessionStateFromContext (System.Web.HttpContext context)

Parameters

context
The System.Web.HttpContext from which to retrieve session data.

Returns

An System.Web.SessionState.IHttpSessionState implementation instance populated with session data from the current request.

Remarks

The SessionStateUtility.GetHttpSessionStateFromContext(System.Web.HttpContext) method can be used by a session-state module to retrieve session data from the current request. This occurs during the System.Web.HttpApplication.ReleaseRequestState event at the end of a request. The returned session data can then be written to the session data store. If the session has been abandoned, the session data can be removed from the data store and System.Web.HttpContext, and the Session_OnEnd event can be executed.

Requirements

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