Class HttpSessionContext<TSessionToken>
Provides an abstraction for handling user sessions and tokens in an HTTP context.
Implements
Inherited Members
Namespace: Singulink.Net.Http.Api.Service
Assembly: Singulink.Net.Http.Api.Service.dll
Syntax
public abstract class HttpSessionContext<TSessionToken> : SessionContext<TSessionToken>, IBindableFromHttpContext<SessionContext<TSessionToken>>, IBindableFromHttpContext<HttpSessionContext<TSessionToken>> where TSessionToken : class, ISessionToken
Type Parameters
| Name | Description |
|---|---|
| TSessionToken |
Constructors
| Name | Description |
|---|---|
| HttpSessionContext(IOriginValidator) | Initializes a new instance of the HttpSessionContext<TSessionToken> class. |
Properties
| Name | Description |
|---|---|
| Device | Gets the device information from the User-Agent header in the request. Returns a parsed device platform, name and version if it could be identified, otherwise returns the raw user agent string. |
| HttpContext | Gets the HTTP context for the current request. |
| IpAddress | Gets the IP address of the current request. If the IP address cannot be determined, returns null. |
| OriginValidator | Gets the origin validator used to validate request origins. |
Methods
| Name | Description |
|---|---|
| IsRequestOriginAllowed() | Validates the current request origin against allowed origins. If the request contains an origin identifier, it must match one of the allowed origins. |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IBindableFromHttpContext<HttpSessionContext<TSessionToken>>.BindAsync(HttpContext, ParameterInfo) | Binds the SessionContext<TSessionToken> parameter value. |