SessionStateStoreProviderBase.CreateNewStoreData(HttpContext, Int32) Method

Definition

Creates a new SessionStateStoreData object to be used for the current request.

public:
 abstract System::Web::SessionState::SessionStateStoreData ^ CreateNewStoreData(System::Web::HttpContext ^ context, int timeout);
public abstract System.Web.SessionState.SessionStateStoreData CreateNewStoreData (System.Web.HttpContext context, int timeout);
abstract member CreateNewStoreData : System.Web.HttpContext * int -> System.Web.SessionState.SessionStateStoreData
Public MustOverride Function CreateNewStoreData (context As HttpContext, timeout As Integer) As SessionStateStoreData

Parameters

context
HttpContext

The HttpContext for the current request.

timeout
Int32

The session-state Timeout value for the new SessionStateStoreData.

Returns

A new SessionStateStoreData for the current request.

Examples

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

Remarks

The SessionStateModule object calls the CreateNewStoreData method at the beginning of a request for an ASP.NET page, during the AcquireRequestState event. The CreateNewStoreData method is called if:

  • the incoming request has no session ID, or

  • the incoming request has a session ID, but the session is not found in the data store.

The CreateNewStoreData method creates a new SessionStateStoreData object with an empty ISessionStateItemCollection object, an HttpStaticObjectsCollection collection, and the specified timeout value. The HttpStaticObjectsCollection collection for the ASP.NET application can be retrieved using the GetSessionStaticObjects method.

Applies to

See also