IHttpSessionState.Abandon Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Ends the current session.

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

abstract Abandon : unit -> unit

The Abandon method is used to clear out session data and raise the Session_OnEnd event defined in the Global.asax file for the ASP.NET application.

The following code example implements the Abandon method of the IHttpSessionState interface. The code example duplicates the behavior of the HttpSessionStateContainer class in that it adds an IsAbandoned property that is set to true when the Abandon method is called. The IsAbandoned property is checked by the session-state module during the ReleaseRequestState event to determine whether the session has been abandoned, and the session-state module clears out session data and executes the Session_OnEnd event.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: