ISessionIDManager.RemoveSessionID Method (HttpContext)

 

Deletes the session identifier from the cookie or from the URL.

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

void RemoveSessionID(
	HttpContext context
)

Parameters

context
Type: System.Web.HttpContext

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

The SessionStateModule calls the RemoveSessionID method during the HttpApplication.ReleaseRequestState event to remove the session identifier from the HttpResponse.Cookies collection if a new session was created but was not used.

The following code example implements the RemoveSessionID method.

public void RemoveSessionID(HttpContext context)
{
  context.Response.Cookies.Remove(pConfig.CookieName);
}

.NET Framework
Available since 2.0
Return to top
Show: