Class IgniteSessionStateStoreProvider
ASP.NET Session-State Store Provider that uses Ignite distributed cache as an underlying storage.
You can either start Ignite yourself, and provide gridName attribute,
or provide igniteConfigurationSectionName attribute to start Ignite automatically from specified
configuration section (see IgniteConfigurationSection)
using igniteConfigurationSectionName.
cacheName attribute specifies Ignite cache name to use for data storage. This attribute can be omitted
if cache name is null.
Optional applicationId attribute allows sharing a single Ignite cache between multiple web applications.
Inheritance
Namespace: Apache.Ignite.AspNet
Assembly: Apache.Ignite.AspNet.dll
Syntax
public class IgniteSessionStateStoreProvider : SessionStateStoreProviderBase
Fields
DefaultCacheName
The default cache name to be used when cacheName attribute is not specified.
Declaration
public const string DefaultCacheName = null
Field Value
| Type | Description |
|---|---|
| System.String |
Methods
CreateNewStoreData(HttpContext, Int32)
Creates a new
Declaration
public override SessionStateStoreData CreateNewStoreData(HttpContext context, int timeout)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
| System.Int32 | timeout | The session-state |
Returns
| Type | Description |
|---|---|
| SessionStateStoreData | A new |
CreateUninitializedItem(HttpContext, String, Int32)
Adds a new session-state item to the data store.
Declaration
public override void CreateUninitializedItem(HttpContext context, string id, int timeout)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
| System.String | id | The |
| System.Int32 | timeout | The session |
Dispose()
Releases all resources used by the
Declaration
public override void Dispose()
EndRequest(HttpContext)
Called by the
Declaration
public override void EndRequest(HttpContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
GetItem(HttpContext, String, out Boolean, out TimeSpan, out Object, out SessionStateActions)
Returns read-only session-state data from the session data store.
Declaration
public override SessionStateStoreData GetItem(HttpContext context, string id, out bool locked, out TimeSpan lockAge, out object lockId, out SessionStateActions actions)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
| System.String | id | The |
| System.Boolean | locked | When this method returns, contains a Boolean value that is set to true if the requested session item is locked at the session data store; otherwise, false. |
| TimeSpan | lockAge | When this method returns, contains a |
| System.Object | lockId | When this method returns, contains an object that is set to the lock identifier
for the current request. For details on the lock identifier, see "Locking Session-Store Data"
in the |
| SessionStateActions | actions | When this method returns, contains one of the
|
Returns
| Type | Description |
|---|---|
| SessionStateStoreData | A |
GetItemExclusive(HttpContext, String, out Boolean, out TimeSpan, out Object, out SessionStateActions)
Returns read-only session-state data from the session data store.
Declaration
public override SessionStateStoreData GetItemExclusive(HttpContext context, string id, out bool locked, out TimeSpan lockAge, out object lockId, out SessionStateActions actions)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
| System.String | id | The |
| System.Boolean | locked | When this method returns, contains a Boolean value that is set to true if a lock is successfully obtained; otherwise, false. |
| TimeSpan | lockAge | When this method returns, contains a |
| System.Object | lockId | When this method returns, contains an object that is set to the lock identifier
for the current request. For details on the lock identifier, see "Locking Session-Store Data" in
the |
| SessionStateActions | actions | When this method returns, contains one of the
|
Returns
| Type | Description |
|---|---|
| SessionStateStoreData | A |
Initialize(String, NameValueCollection)
Initializes the provider.
Declaration
public override void Initialize(string name, NameValueCollection config)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The friendly name of the provider. |
| NameValueCollection | config | A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider. |
InitializeRequest(HttpContext)
Called by the
Declaration
public override void InitializeRequest(HttpContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
ReleaseItemExclusive(HttpContext, String, Object)
Releases a lock on an item in the session data store.
Declaration
public override void ReleaseItemExclusive(HttpContext context, string id, object lockId)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
| System.String | id | The session identifier for the current request. |
| System.Object | lockId | The lock identifier for the current request. |
RemoveItem(HttpContext, String, Object, SessionStateStoreData)
Deletes item data from the session data store.
Declaration
public override void RemoveItem(HttpContext context, string id, object lockId, SessionStateStoreData item)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
| System.String | id | The session identifier for the current request. |
| System.Object | lockId | The lock identifier for the current request. |
| SessionStateStoreData | item | The |
ResetItemTimeout(HttpContext, String)
Updates the expiration date and time of an item in the session data store.
Declaration
public override void ResetItemTimeout(HttpContext context, string id)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
| System.String | id | The session identifier for the current request. |
SetAndReleaseItemExclusive(HttpContext, String, SessionStateStoreData, Object, Boolean)
Updates the session-item information in the session-state data store with values from the current request, and clears the lock on the data.
Declaration
public override void SetAndReleaseItemExclusive(HttpContext context, string id, SessionStateStoreData item, object lockId, bool newItem)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpContext | context | The |
| System.String | id | The session identifier for the current request. |
| SessionStateStoreData | item | The |
| System.Object | lockId | The lock identifier for the current request. |
| System.Boolean | newItem | true to identify the session item as a new item; false to identify the session item as an existing item. |
SetItemExpireCallback(SessionStateItemExpireCallback)
Sets a reference to the
Declaration
public override bool SetItemExpireCallback(SessionStateItemExpireCallback expireCallback)
Parameters
| Type | Name | Description |
|---|---|---|
| SessionStateItemExpireCallback | expireCallback | The |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the session-state store provider supports calling the Session_OnEnd event; otherwise, false. |