DistributedSessionStore.Create Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Create(String, TimeSpan, Func<Boolean>, Boolean) | |
Create(String, TimeSpan, TimeSpan, Func<Boolean>, Boolean) |
Create a new or resume an ISession. |
Create(String, TimeSpan, Func<Boolean>, Boolean)
public:
virtual Microsoft::AspNetCore::Http::ISession ^ Create(System::String ^ sessionKey, TimeSpan idleTimeout, Func<bool> ^ tryEstablishSession, bool isNewSessionKey);
public Microsoft.AspNetCore.Http.ISession Create (string sessionKey, TimeSpan idleTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey);
abstract member Create : string * TimeSpan * Func<bool> * bool -> Microsoft.AspNetCore.Http.ISession
override this.Create : string * TimeSpan * Func<bool> * bool -> Microsoft.AspNetCore.Http.ISession
Public Function Create (sessionKey As String, idleTimeout As TimeSpan, tryEstablishSession As Func(Of Boolean), isNewSessionKey As Boolean) As ISession
Parameters
- sessionKey
- String
- idleTimeout
- TimeSpan
- isNewSessionKey
- Boolean
Returns
Implements
Applies to
Create(String, TimeSpan, TimeSpan, Func<Boolean>, Boolean)
- Source:
- DistributedSessionStore.cs
- Source:
- DistributedSessionStore.cs
- Source:
- DistributedSessionStore.cs
Create a new or resume an ISession.
public:
virtual Microsoft::AspNetCore::Http::ISession ^ Create(System::String ^ sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> ^ tryEstablishSession, bool isNewSessionKey);
public Microsoft.AspNetCore.Http.ISession Create (string sessionKey, TimeSpan idleTimeout, TimeSpan ioTimeout, Func<bool> tryEstablishSession, bool isNewSessionKey);
abstract member Create : string * TimeSpan * TimeSpan * Func<bool> * bool -> Microsoft.AspNetCore.Http.ISession
override this.Create : string * TimeSpan * TimeSpan * Func<bool> * bool -> Microsoft.AspNetCore.Http.ISession
Public Function Create (sessionKey As String, idleTimeout As TimeSpan, ioTimeout As TimeSpan, tryEstablishSession As Func(Of Boolean), isNewSessionKey As Boolean) As ISession
Parameters
- sessionKey
- String
A unique key used to lookup the session.
- idleTimeout
- TimeSpan
How long the session can be inactive (e.g. not accessed) before it will expire.
- ioTimeout
- TimeSpan
The maximum amount of time LoadAsync(CancellationToken) and CommitAsync(CancellationToken) are allowed take.
A callback invoked during Set(String, Byte[]) to verify that modifying the session is currently valid.
If the callback returns false
, Set(String, Byte[]) should throw an InvalidOperationException.
SessionMiddleware provides a callback that returns false
if the session was not established
prior to sending the response.
- isNewSessionKey
- Boolean
true
if establishing a new session; false
if resuming a session.
Returns
The ISession that was created or resumed.