ISessionIDManager.GetSessionID Method
Assembly: System.Web (in system.web.dll)
String GetSessionID ( HttpContext context )
function GetSessionID (
context : HttpContext
) : String
Not applicable.
Parameters
- context
The current HttpContext object that references server objects used to process HTTP requests (for example, the Request and Response properties).
Return Value
The current session identifier sent with the HTTP request.The GetSessionID method is called by the SessionStateModule during the System.Web.HttpApplication.AcquireRequestState and System.Web.HttpApplication.EndRequest events. If you cannot retrieve a valid session identifier from the HTTP request, return a null reference (Nothing in Visual Basic). If the SessionStateModule receives a null reference (Nothing in Visual Basic) from the GetSessionID method, it will call the CreateSessionID method to get a new session identifier for a new session.
If it is possible that the value returned by your CreateSessionID implementation contains characters that are not valid in an HTTP response or request, you should use the UrlEncode method to encode the session-identifier value in your SaveSessionID method implementation and the UrlDecode method to decode the session-identifier value in your GetSessionID method implementation.