SessionStateStoreProviderBase.SetItemExpireCallback Method (SessionStateItemExpireCallback)

 

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)

abstract SetItemExpireCallback : 
        expireCallback:SessionStateItemExpireCallback -> bool

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
Available since 2.0
Return to top
Show: