System.Web.SessionState.SessionStateStoreProviderBase.SetItemExpireCallback Method

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

Syntax

public abstract bool SetItemExpireCallback (SessionStateItemExpireCallback expireCallback)

Parameters

expireCallback
The System.Web.SessionState.SessionStateItemExpireCallback delegate for the Session_OnEnd event defined in the Global.asax file.

Returns

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

Remarks

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

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

Requirements

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