Export (0) Print
Expand All

SessionStateStoreProviderBase.CreateNewStoreData Method

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

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

abstract CreateNewStoreData : 
        context:HttpContext * 
        timeout:int -> SessionStateStoreData


Type: System.Web.HttpContext

The HttpContext for the current request.

Type: System.Int32

The session-state Timeout value for the new SessionStateStoreData.

Return Value

Type: System.Web.SessionState.SessionStateStoreData
A new SessionStateStoreData for the current request.

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.

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

.NET Framework

Supported in: 4.5.2, 4.5.1, 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.

© 2014 Microsoft