Export (0) Print
Expand All

SessionStateStoreProviderBase.SetItemExpireCallback Method

Sets a reference to the SessionStateItemExpireCallback delegate for the Session_OnEnd event defined in the Global.asax file.

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

public abstract bool SetItemExpireCallback(
	SessionStateItemExpireCallback expireCallback
)

Parameters

expireCallback
Type: System.Web.SessionState.SessionStateItemExpireCallback

The SessionStateItemExpireCallback delegate for the Session_OnEnd event defined in the Global.asax file.

Return Value

Type: System.Boolean
true if the session-state store provider supports calling the Session_OnEnd event; otherwise, false.

The SessionStateModule object calls the SetItemExpireCallback method when the module is initialized to determine whether calls to the Session_OnEnd event are supported by the SessionStateStoreProviderBase implementation and to associate the SessionStateItemExpireCallback delegate with the Session_OnEnd event.

Custom session-state store provider implementers should use the SetItemExpireCallback method to inform the SessionStateModule object whether calls to the Session_OnEnd event are supported and to set a local reference to the SessionStateItemExpireCallback delegate supplied by the expireCallback parameter. The custom implementation must decide when the local SessionStateItemExpireCallback delegate will be called. For example, the delegate could be called during the call to the RemoveItem method, which is called when a session is abandoned.

For an example of a session-state store provider implementation, see Implementing a Session-State Store Provider.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft