System.Web.SessionState.ISessionIDManager.CreateSessionID Method

Creates a unique session identifier.

Syntax

public string CreateSessionID (System.Web.HttpContext context)

Parameters

context
The current System.Web.HttpContext object that references server objects used to process HTTP requests (for example, the System.Web.HttpContext.Request and System.Web.HttpContext.Response properties).

Returns

A unique session identifier.

Remarks

The ISessionIDManager.CreateSessionID(System.Web.HttpContext) method is used to generate a unique session identifier that the System.Web.SessionState.SessionStateModule object will use to identify a new session. The value returned by ISessionIDManager.CreateSessionID(System.Web.HttpContext) must be unique and must contain valid characters that can be stored in an HTTP response and request. If it is possible that the value returned by your ISessionIDManager.CreateSessionID(System.Web.HttpContext) implementation contains characters that are not valid in an HTTP response or request, you should use the erload:System.Web.HttpUtility.UrlEncode method to encode the session-identifier value in your ISessionIDManager.SaveSessionID(System.Web.HttpContext, string, Boolean@, Boolean@) method implementation and the erload:System.Web.HttpUtility.UrlDecode method to decode the session-identifier value in your ISessionIDManager.GetSessionID(System.Web.HttpContext) method implementation.

Requirements

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