Interface ISession
Describes user session
Inherited Members
Namespace: Azos.Apps
Assembly: Azos.dll
Syntax
public interface ISession : IPrincipal
Properties
ID
Gets unique session identifier
Declaration
Guid ID { get; }
Property Value
Type | Description |
---|---|
System.Guid |
IsJustLoggedIn
Indicates that user login happened in current request processing cycle. This flag is useful for long term token assignment on release
Declaration
bool IsJustLoggedIn { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsNew
Indicates that session object was just created with current request processing cycle
Declaration
bool IsNew { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[Object]
Shortcut to this.Items.TryGetValue(...). Returns null if key is not found
Declaration
object this[object key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Object | key |
Property Value
Type | Description |
---|---|
System.Object |
Items
References item dictionary that may be used to persist object graphs per session
Declaration
IDictionary<object, object> Items { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.Object, System.Object> |
LanguageISOCode
Returns user's language preference or null
Declaration
string LanguageISOCode { get; }
Property Value
Type | Description |
---|---|
System.String |
LastLoginType
Returns last login type
Declaration
SessionLoginType LastLoginType { get; }
Property Value
Type | Description |
---|---|
SessionLoginType |
LastLoginUTC
Returns the UTC DateTime of the last login/when HasJustLoggedIn() was called for the last time within the lifetime of this session object or NULL
Declaration
DateTime? LastLoginUTC { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
OldID
When this parameter is not null then RegenerateID() was called and session provider may need to re-stow session object under a new ID
Declaration
Guid? OldID { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Guid> |
User
References a user this session is for
Declaration
User User { get; set; }
Property Value
Type | Description |
---|---|
User |
Methods
Acquire()
Acquires session for use
Declaration
void Acquire()
HasJustLoggedIn(SessionLoginType, DateTime)
Sets IsJustLoggedIn to true to indicate that user has supplied credentials/got checked via security manager. The caller of this method is implementation-specific and depends on what is considered to be "proof of users' identity"
Declaration
void HasJustLoggedIn(SessionLoginType loginType, DateTime utcNow)
Parameters
Type | Name | Description |
---|---|---|
SessionLoginType | loginType | |
System.DateTime | utcNow |
RegenerateID()
Generates new GUID and stores it in ID storing old ID value in OldID property which is not serializable. The implementations may elect to re-stow the existing session under the new ID. This method is useful for security, i.e. when user logs-in we may want to re-generate ID
Declaration
void RegenerateID()
Release()
Releases session after use
Declaration
void Release()