Show / Hide Table of Contents

Class BaseSession

Implements base ISession functionality

Inheritance
System.Object
BaseSession
WaveSession
Implements
ISession
IEndableInstance
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.ApplicationModel
Assembly: NFX.dll
Syntax
[Serializable]
public class BaseSession : ISession, IEndableInstance

Constructors

BaseSession()

Declaration
protected BaseSession()

BaseSession(Guid)

Declaration
public BaseSession(Guid id)
Parameters
Type Name Description
System.Guid id

Properties

ID

Returns Session ID

Declaration
public Guid ID { get; }
Property Value
Type Description
System.Guid

IDSecret

Returns Session ID secret - the ulong that identifies this session. This property is needed for cross-check upon GUID id lookup, so that Session ID GUID can not be forged by the client - a form of a "password"

Declaration
public ulong IDSecret { get; }
Property Value
Type Description
System.UInt64

IsEnded

Indicates whether this session was ended and will be destroyed after current request processing cycle

Declaration
public bool IsEnded { get; }
Property Value
Type Description
System.Boolean

IsJustLoggedIn

Indicates that user login happened in current request processing cycle. This flag is useful for long term token assignment on release

Declaration
public bool IsJustLoggedIn { get; }
Property Value
Type Description
System.Boolean

IsNew

Indicates that session object was just created with current request processing cycle

Declaration
public bool IsNew { get; }
Property Value
Type Description
System.Boolean

Item[Object]

Shortcut to .Items. Getter return null instead of throwing if key is not found

Declaration
public object this[object key] { get; set; }
Parameters
Type Name Description
System.Object key
Property Value
Type Description
System.Object

Items

Provides a thread-safe dictionary of items

Declaration
public IDictionary<object, object> Items { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Object, System.Object>

LanguageISOCode

Returns user language preference or null

Declaration
public virtual string LanguageISOCode { get; }
Property Value
Type Description
System.String

LastLoginType

Returns the last login type

Declaration
public 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
public 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
public Guid? OldID { get; }
Property Value
Type Description
System.Nullable<System.Guid>

User

Returns session user

Declaration
public User User { get; set; }
Property Value
Type Description
User

Methods

Acquire()

Declaration
public virtual void Acquire()

End()

Ends session

Declaration
public virtual void End()

HasJustLoggedIn(SessionLoginType)

Called from business code when user supplies login credentals and/or performs another action that can be qualified as a reliable user identity proof

Declaration
public virtual void HasJustLoggedIn(SessionLoginType loginType)
Parameters
Type Name Description
SessionLoginType loginType

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 usefull for security, i.e. when user logs-in we may want to re-generate ID

Declaration
public void RegenerateID()

Release()

Declaration
public virtual void Release()

Implements

ISession
IEndableInstance

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX