DistributedSession Class
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.
An ISession backed by an IDistributedCache.
public ref class DistributedSession : Microsoft::AspNetCore::Http::ISession
public class DistributedSession : Microsoft.AspNetCore.Http.ISession
type DistributedSession = class
interface ISession
Public Class DistributedSession
Implements ISession
- Inheritance
-
DistributedSession
- Implements
Id |
A unique identifier for the current session. This is not the same as the session cookie since the cookie lifetime may not be the same as the session entry lifetime in the data store. |
Is |
Indicates whether the current session loaded successfully. Accessing this property before the session is loaded will cause it to be loaded inline. |
Keys |
Enumerates all the keys, if any. |
Clear() |
Remove all entries from the current session, if any. The session cookie is not removed. |
Commit |
|
Commit |
Store the session in the data store. This may throw if the data store is unavailable. |
Load |
|
Load |
Load the session from the data store. This may throw if the data store is unavailable. |
Remove(String) |
Remove the given key from the session if present. |
Set(String, Byte[]) |
Set the given key and value in the current session. This will throw if the session was not established prior to sending the response. |
Try |
Retrieve the value of the given key, if present. |
Get(ISession, String) |
Gets a byte-array value from ISession. |
Get |
Gets an int value from ISession. |
Get |
Gets a string value from ISession. |
Set |
Sets an int value in the ISession. |
Set |