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
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
AddSessionIdToRequestFilter(IRequest, IResponse, Object)
View Source
Declaration
public static void AddSessionIdToRequestFilter(IRequest req, IResponse res, object requestDto)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
ServiceStack.Web.IResponse | res |
System.Object | requestDto |
CreateSessionIds(IRequest, IResponse)
View Source
Declaration
public static string CreateSessionIds(IRequest httpReq = null, IResponse httpRes = null)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
ServiceStack.Web.IResponse | httpRes |
GetSessionKey(IRequest)
View Source
Declaration
public static string GetSessionKey(IRequest httpReq = null)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
GetSessionKey(String)
View Source
Declaration
public static string GetSessionKey(string sessionId)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | sessionId |
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
Type | Name |
---|---|
ServiceStack.Caching.ICacheClient | cache |
ServiceStack.Web.IRequest | httpReq |
ServiceStack.Web.IResponse | httpRes |
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
Type | Name |
---|---|
ServiceStack.Caching.ICacheClientAsync | cache |
ServiceStack.Web.IRequest | httpReq |
ServiceStack.Web.IResponse | httpRes |
System.Threading.CancellationToken | token |
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
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
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
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
System.String | sessionId |