Skip to main content

SessionFeature

Assembly: ServiceStack.dll
View Source
Declaration
public class SessionFeature : IPlugin, IHasStringId, IHasId<string>

Properties

Id

View Source
Declaration
public string Id { get; set; }

SessionExpiry

View Source
Declaration
public TimeSpan? SessionExpiry { get; set; }

SessionBagExpiry

View Source
Declaration
public TimeSpan? SessionBagExpiry { get; set; }

PermanentSessionExpiry

View Source
Declaration
public TimeSpan? PermanentSessionExpiry { get; set; }

Fields

SessionId

View Source
Declaration
public const string SessionId = "ss-id"

PermanentSessionId

View Source
Declaration
public const string PermanentSessionId = "ss-pid"

SessionOptionsKey

View Source
Declaration
public const string SessionOptionsKey = "ss-opt"

XUserAuthId

View Source
Declaration
public const string XUserAuthId = "X-UAId"

DefaultSessionExpiry

View Source
Declaration
public static TimeSpan DefaultSessionExpiry

DefaultPermanentSessionExpiry

View Source
Declaration
public static TimeSpan DefaultPermanentSessionExpiry

Methods

Register(IAppHost)

View Source
Declaration
public void Register(IAppHost appHost)
Parameters
TypeName
ServiceStack.IAppHostappHost

AddSessionIdToRequestFilter(IRequest, IResponse, Object)

View Source
Declaration
public static void AddSessionIdToRequestFilter(IRequest req, IResponse res, object requestDto)
Parameters
TypeName
ServiceStack.Web.IRequestreq
ServiceStack.Web.IResponseres
System.ObjectrequestDto

CreateSessionIds(IRequest, IResponse)

View Source
Declaration
public static string CreateSessionIds(IRequest httpReq = null, IResponse httpRes = null)
Returns

System.String

Parameters
TypeName
ServiceStack.Web.IRequesthttpReq
ServiceStack.Web.IResponsehttpRes

GetSessionKey(IRequest)

View Source
Declaration
public static string GetSessionKey(IRequest httpReq = null)
Returns

System.String

Parameters
TypeName
ServiceStack.Web.IRequesthttpReq

GetSessionKey(String)

View Source
Declaration
public static string GetSessionKey(string sessionId)
Returns

System.String

Parameters
TypeName
System.StringsessionId

GetOrCreateSession<T>(ICacheClient, IRequest, IResponse)

View Source
Declaration
public static T GetOrCreateSession<T>(ICacheClient cache = null, IRequest httpReq = null, IResponse httpRes = null)
Returns

<T>

Parameters
TypeName
ServiceStack.Caching.ICacheClientcache
ServiceStack.Web.IRequesthttpReq
ServiceStack.Web.IResponsehttpRes
Type Parameters
  • T

GetOrCreateSessionAsync<T>(ICacheClientAsync, IRequest, IResponse, CancellationToken)

View Source
Declaration
public static async Task<T> GetOrCreateSessionAsync<T>(ICacheClientAsync cache = null, IRequest httpReq = null, IResponse httpRes = null, CancellationToken token = default(CancellationToken))
Returns

System.Threading.Tasks.Task<<T>>

Parameters
TypeName
ServiceStack.Caching.ICacheClientAsynccache
ServiceStack.Web.IRequesthttpReq
ServiceStack.Web.IResponsehttpRes
System.Threading.CancellationTokentoken
Type Parameters
  • T

CreateNewSession(IRequest)

Creates a new Session without an Id

View Source
Declaration
public static IAuthSession CreateNewSession(IRequest httpReq)
Returns

ServiceStack.Auth.IAuthSession

Parameters
TypeName
ServiceStack.Web.IRequesthttpReq

CreateNewSession(IRequest, String)

Creates a new Session with the specified sessionId otherwise it's populated with a new generated Session Id that's

View Source
Declaration
public static IAuthSession CreateNewSession(IRequest httpReq, string sessionId)
Returns

ServiceStack.Auth.IAuthSession

Parameters
TypeName
ServiceStack.Web.IRequesthttpReq
System.StringsessionId

Implements