SessionManager

Overview

This is the abstract base class for all session manager implementations. You will descend from this class when implementing a custom session manager, or use one of the existing descendants.

Location


 

constructor  protected

 

constructor(register: Boolean; initializeSessionExpirationTimer: Boolean)

 

SessionManager(Boolean register, Boolean initializeSessionExpirationTimer)

 

Sub New(register As Boolean, initializeSessionExpirationTimer As Boolean)

Parameters:

  • register:
  • initializeSessionExpirationTimer:

CreateNewSession  protected

 

method CreateNewSession(sessionId: Guid): ISession

 

ISession CreateNewSession(Guid sessionId)

 

Function CreateNewSession(sessionId As Guid) As ISession

Parameters:

  • sessionId:

DestroySession (ISession)

 

method DestroySession(session: ISession)

 

void DestroySession(ISession session)

 

Sub DestroySession(session As ISession)

Parameters:

  • session:

DestroySession (Guid)

 

method DestroySession(sessionId: Guid)

 

void DestroySession(Guid sessionId)

 

Sub DestroySession(sessionId As Guid)

Parameters:

  • sessionId:

Dispose  protected

 

method Dispose(disposing: Boolean)

 

void Dispose(Boolean disposing)

 

Sub Dispose(disposing As Boolean)

Parameters:

  • disposing:

ExpireSessions

This method will expire all sessions in the Session Manager that have exceeded the timeout. Note: SessionManager will regularly check for expired sessions automatically, but you can use this method to trigger an expiration cycle manually.

 

method ExpireSessions

 

void ExpireSessions()

 

Sub ExpireSessions()

GetAllSessions

 

method GetAllSessions: IList<Guid>

 

IList<Guid> GetAllSessions()

 

Function GetAllSessions() As IList<Guid>

GetExistingSession

Returns existing session with provided Id or null in case the session cannot be found. Depending on the updateTime parameter value updates the session's LastaccessedTime attribute.

 

method GetExistingSession(sessionId: Guid; updateTime: Boolean): ISession

 

ISession GetExistingSession(Guid sessionId, Boolean updateTime)

 

Function GetExistingSession(sessionId As Guid, updateTime As Boolean) As ISession

Parameters:

  • sessionId: Session Id
  • updateTime: Flag indicating whether session's LastAccessedTime attribute should be updated

GetSession

Returns session with provided Id. If there is no session stored with the provided Id then new session is created.

 

method GetSession(sessionId: Guid): ISession

 

ISession GetSession(Guid sessionId)

 

Function GetSession(sessionId As Guid) As ISession

Parameters:

  • sessionId: Session Id

IsOutOfProcess

 

property IsOutOfProcess: Boolean read;

 

Boolean IsOutOfProcess { get; }

 

ReadOnly Property IsOutOfProcess() As Boolean

LocateExistingSession  protected

 

method LocateExistingSession(sessionId: Guid; updateTime: Boolean): ISession

 

ISession LocateExistingSession(Guid sessionId, Boolean updateTime)

 

Function LocateExistingSession(sessionId As Guid, updateTime As Boolean) As ISession

Parameters:

  • sessionId:
  • updateTime:

OnSessionCreated

Gets triggered after a new Session has been created. You can use it to perform initialization functions or fill the session with default values.

 

event OnSessionCreated: SessionEventHandler;
delegate: method OnSessionCreated(sender: Object; e: SessionEventArgs)

 

delegate SessionEventHandler OnSessionCreated()
delegate: void OnSessionCreated(Object sender, SessionEventArgs e)

 

Event OnSessionCreated As SessionEventHandler
delegate: Sub OnSessionCreated(sender As Object, e As SessionEventArgs)

OnSessionDestroyed

Gets triggered after a new Session has been manually destroyed. You can use it to perform cleanup for a specific session id.

Note: The session has already been Disposed when the OnSessionDestroyed event fires. This event will not fire for sessions that expire.

 

event OnSessionDestroyed: SessionIDEventHandler;
delegate: method OnSessionDestroyed(sender: Object; e: SessionIDEventArgs)

 

delegate SessionIDEventHandler OnSessionDestroyed()
delegate: void OnSessionDestroyed(Object sender, SessionIDEventArgs e)

 

Event OnSessionDestroyed As SessionIDEventHandler
delegate: Sub OnSessionDestroyed(sender As Object, e As SessionIDEventArgs)

OnSessionExpired

Gets triggered after a new Session has been expired. You can use it to perform cleanup and/or inspect the values of the expired session.

Note: The session has already been Disposed when the OnSessionExpired event fires. This event will not fire for sessions that are manually destroyed.

 

event OnSessionExpired: SessionEventHandler;
delegate: method OnSessionExpired(sender: Object; e: SessionEventArgs)

 

delegate SessionEventHandler OnSessionExpired()
delegate: void OnSessionExpired(Object sender, SessionEventArgs e)

 

Event OnSessionExpired As SessionEventHandler
delegate: Sub OnSessionExpired(sender As Object, e As SessionEventArgs)

ReleaseSession

 

method ReleaseSession(session: ISession)

 

void ReleaseSession(ISession session)

 

Sub ReleaseSession(session As ISession)

Parameters:

  • session:

SessionCount  protected

 

property SessionCount: Int32 read;

 

Int32 SessionCount { get; }

 

ReadOnly Property SessionCount() As Int32

Timeout

Determines the timeout (in seconds) after which sessions will be discarded if they have not been accessed. The default value is 600 seconds (10 minutes).

 

property Timeout: Int32 read write;

 

Int32 Timeout { get; set; }

 

Property Timeout() As Int32

TriggerOnSessionCreated  protected

 

method TriggerOnSessionCreated(e: SessionEventArgs)

 

void TriggerOnSessionCreated(SessionEventArgs e)

 

Sub TriggerOnSessionCreated(e As SessionEventArgs)

Parameters:

  • e:

TriggerOnSessionDestroyed  protected

 

method TriggerOnSessionDestroyed(e: SessionIDEventArgs)

 

void TriggerOnSessionDestroyed(SessionIDEventArgs e)

 

Sub TriggerOnSessionDestroyed(e As SessionIDEventArgs)

Parameters:

  • e:

TriggerOnSessionExpired  protected

 

method TriggerOnSessionExpired(e: SessionEventArgs)

 

void TriggerOnSessionExpired(SessionEventArgs e)

 

Sub TriggerOnSessionExpired(e As SessionEventArgs)

Parameters:

  • e:

 

IsOutOfProcess

 

property IsOutOfProcess: Boolean read;

 

Boolean IsOutOfProcess { get; }

 

ReadOnly Property IsOutOfProcess() As Boolean

SessionCount  protected

 

property SessionCount: Int32 read;

 

Int32 SessionCount { get; }

 

ReadOnly Property SessionCount() As Int32

Timeout

Determines the timeout (in seconds) after which sessions will be discarded if they have not been accessed. The default value is 600 seconds (10 minutes).

 

property Timeout: Int32 read write;

 

Int32 Timeout { get; set; }

 

Property Timeout() As Int32

 

constructor  protected

 

constructor(register: Boolean; initializeSessionExpirationTimer: Boolean)

 

SessionManager(Boolean register, Boolean initializeSessionExpirationTimer)

 

Sub New(register As Boolean, initializeSessionExpirationTimer As Boolean)

Parameters:

  • register:
  • initializeSessionExpirationTimer:

CreateNewSession  protected

 

method CreateNewSession(sessionId: Guid): ISession

 

ISession CreateNewSession(Guid sessionId)

 

Function CreateNewSession(sessionId As Guid) As ISession

Parameters:

  • sessionId:

DestroySession (ISession)

 

method DestroySession(session: ISession)

 

void DestroySession(ISession session)

 

Sub DestroySession(session As ISession)

Parameters:

  • session:

DestroySession (Guid)

 

method DestroySession(sessionId: Guid)

 

void DestroySession(Guid sessionId)

 

Sub DestroySession(sessionId As Guid)

Parameters:

  • sessionId:

Dispose  protected

 

method Dispose(disposing: Boolean)

 

void Dispose(Boolean disposing)

 

Sub Dispose(disposing As Boolean)

Parameters:

  • disposing:

ExpireSessions

This method will expire all sessions in the Session Manager that have exceeded the timeout. Note: SessionManager will regularly check for expired sessions automatically, but you can use this method to trigger an expiration cycle manually.

 

method ExpireSessions

 

void ExpireSessions()

 

Sub ExpireSessions()

GetAllSessions

 

method GetAllSessions: IList<Guid>

 

IList<Guid> GetAllSessions()

 

Function GetAllSessions() As IList<Guid>

GetExistingSession

Returns existing session with provided Id or null in case the session cannot be found. Depending on the updateTime parameter value updates the session's LastaccessedTime attribute.

 

method GetExistingSession(sessionId: Guid; updateTime: Boolean): ISession

 

ISession GetExistingSession(Guid sessionId, Boolean updateTime)

 

Function GetExistingSession(sessionId As Guid, updateTime As Boolean) As ISession

Parameters:

  • sessionId: Session Id
  • updateTime: Flag indicating whether session's LastAccessedTime attribute should be updated

GetSession

Returns session with provided Id. If there is no session stored with the provided Id then new session is created.

 

method GetSession(sessionId: Guid): ISession

 

ISession GetSession(Guid sessionId)

 

Function GetSession(sessionId As Guid) As ISession

Parameters:

  • sessionId: Session Id

LocateExistingSession  protected

 

method LocateExistingSession(sessionId: Guid; updateTime: Boolean): ISession

 

ISession LocateExistingSession(Guid sessionId, Boolean updateTime)

 

Function LocateExistingSession(sessionId As Guid, updateTime As Boolean) As ISession

Parameters:

  • sessionId:
  • updateTime:

ReleaseSession

 

method ReleaseSession(session: ISession)

 

void ReleaseSession(ISession session)

 

Sub ReleaseSession(session As ISession)

Parameters:

  • session:

TriggerOnSessionCreated  protected

 

method TriggerOnSessionCreated(e: SessionEventArgs)

 

void TriggerOnSessionCreated(SessionEventArgs e)

 

Sub TriggerOnSessionCreated(e As SessionEventArgs)

Parameters:

  • e:

TriggerOnSessionDestroyed  protected

 

method TriggerOnSessionDestroyed(e: SessionIDEventArgs)

 

void TriggerOnSessionDestroyed(SessionIDEventArgs e)

 

Sub TriggerOnSessionDestroyed(e As SessionIDEventArgs)

Parameters:

  • e:

TriggerOnSessionExpired  protected

 

method TriggerOnSessionExpired(e: SessionEventArgs)

 

void TriggerOnSessionExpired(SessionEventArgs e)

 

Sub TriggerOnSessionExpired(e As SessionEventArgs)

Parameters:

  • e:

 

OnSessionCreated

Gets triggered after a new Session has been created. You can use it to perform initialization functions or fill the session with default values.

 

event OnSessionCreated: SessionEventHandler;
delegate: method OnSessionCreated(sender: Object; e: SessionEventArgs)

 

delegate SessionEventHandler OnSessionCreated()
delegate: void OnSessionCreated(Object sender, SessionEventArgs e)

 

Event OnSessionCreated As SessionEventHandler
delegate: Sub OnSessionCreated(sender As Object, e As SessionEventArgs)

OnSessionDestroyed

Gets triggered after a new Session has been manually destroyed. You can use it to perform cleanup for a specific session id.

Note: The session has already been Disposed when the OnSessionDestroyed event fires. This event will not fire for sessions that expire.

 

event OnSessionDestroyed: SessionIDEventHandler;
delegate: method OnSessionDestroyed(sender: Object; e: SessionIDEventArgs)

 

delegate SessionIDEventHandler OnSessionDestroyed()
delegate: void OnSessionDestroyed(Object sender, SessionIDEventArgs e)

 

Event OnSessionDestroyed As SessionIDEventHandler
delegate: Sub OnSessionDestroyed(sender As Object, e As SessionIDEventArgs)

OnSessionExpired

Gets triggered after a new Session has been expired. You can use it to perform cleanup and/or inspect the values of the expired session.

Note: The session has already been Disposed when the OnSessionExpired event fires. This event will not fire for sessions that are manually destroyed.

 

event OnSessionExpired: SessionEventHandler;
delegate: method OnSessionExpired(sender: Object; e: SessionEventArgs)

 

delegate SessionEventHandler OnSessionExpired()
delegate: void OnSessionExpired(Object sender, SessionEventArgs e)

 

Event OnSessionExpired As SessionEventHandler
delegate: Sub OnSessionExpired(sender As Object, e As SessionEventArgs)