DistributedSession Class

Namespace
Microsoft.AspNetCore.Session
Assemblies
  • Microsoft.AspNetCore.Session

Syntax

public class DistributedSession : ISession
class Microsoft.AspNetCore.Session.DistributedSession

Constructors

DistributedSession(Microsoft.Extensions.Caching.Distributed.IDistributedCache, System.String, System.TimeSpan, System.Func<System.Boolean>, Microsoft.Extensions.Logging.ILoggerFactory, System.Boolean)
public DistributedSession(IDistributedCache cache, string sessionKey, TimeSpan idleTimeout, Func<bool> tryEstablishSession, ILoggerFactory loggerFactory, bool isNewSessionKey)

Methods

Clear()
public void Clear()
CommitAsync()
Return type:System.Threading.Tasks.Task
public Task CommitAsync()
LoadAsync()
Return type:System.Threading.Tasks.Task
public Task LoadAsync()
Remove(System.String)
public void Remove(string key)
Set(System.String, System.Byte[])
public void Set(string key, byte[] value)
TryGetValue(System.String, out System.Byte[])
Return type:System.Boolean
public bool TryGetValue(string key, out byte[] value)

Properties

Microsoft.AspNetCore.Session.DistributedSession.Id
Return type:System.String
public string Id { get; }
Microsoft.AspNetCore.Session.DistributedSession.IsAvailable
Return type:System.Boolean
public bool IsAvailable { get; }
Microsoft.AspNetCore.Session.DistributedSession.Keys
Return type:System.Collections.Generic.IEnumerable<System.String>
public IEnumerable<string> Keys { get; }