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, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2014 Microsoft