MemorySessionManager

Overview

This is a session manager implementation that uses memory storage for the session data. As such, access to session data is very efficient, but session data will not be persisted when the server is restarted, nor can it be shared between several instances of the server.

Location

 

constructor

 

constructor

 

MemorySessionManager()

 

Sub New

constructor (Boolean)  protected

 

constructor(register: Boolean)

 

MemorySessionManager(Boolean register)

 

Sub New (register As Boolean)

Parameters:

  • register:

constructor (Boolean, Boolean)  protected    (declared in SessionManager)

 

constructor(register: Boolean; initializeSessionExpirationTimer: Boolean)

 

MemorySessionManager(Boolean register, Boolean initializeSessionExpirationTimer)

 

Sub New (register As Boolean, initializeSessionExpirationTimer As Boolean)

Parameters:

  • register:
  • initializeSessionExpirationTimer:

constructor (IContainer)

 

constructor(container: IContainer)

 

MemorySessionManager(IContainer container)

 

Sub New (container As IContainer)

Parameters:

  • container:

add_OnSessionCreated    (declared in SessionManager)

 

method add_OnSessionCreated(value: SessionEventHandler)

 

void add_OnSessionCreated(SessionEventHandler value)

 

Sub add_OnSessionCreated(value As SessionEventHandler)

Parameters:

  • value:

add_OnSessionDestroyed    (declared in SessionManager)

 

method add_OnSessionDestroyed(value: SessionIDEventHandler)

 

void add_OnSessionDestroyed(SessionIDEventHandler value)

 

Sub add_OnSessionDestroyed(value As SessionIDEventHandler)

Parameters:

  • value:

add_OnSessionExpired    (declared in SessionManager)

 

method add_OnSessionExpired(value: SessionEventHandler)

 

void add_OnSessionExpired(SessionEventHandler value)

 

Sub add_OnSessionExpired(value As SessionEventHandler)

Parameters:

  • value:

CreateNewSession  protected

 

method CreateNewSession(sessionId: Guid): ISession

 

ISession CreateNewSession(Guid sessionId)

 

Function CreateNewSession(sessionId As Guid) As ISession

Parameters:

  • sessionId:

DestroySession (Guid)    (declared in SessionManager)

 

method DestroySession(sessionId: Guid)

 

void DestroySession(Guid sessionId)

 

Sub DestroySession(sessionId As Guid)

Parameters:

  • sessionId:

DestroySession (ISession)    (declared in SessionManager)

 

method DestroySession(session: ISession)

 

void DestroySession(ISession session)

 

Sub DestroySession(session As ISession)

Parameters:

  • session:

Dispose  protected    (declared in SessionManager)

 

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    (declared in SessionManager)

 

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:
  • updateTime:

GetSession    (declared in SessionManager)

 

method GetSession(sessionId: Guid): ISession

 

ISession GetSession(Guid sessionId)

 

Function GetSession(sessionId As Guid) As ISession

Parameters:

  • sessionId:

GlobalSessionManager    (declared in SessionManager)

 

class property GlobalSessionManager: ISessionManager read;

 

class ISessionManager GlobalSessionManager { get; }

 

Shared Property ReadOnly GlobalSessionManager As ISessionManager

IsOutOfProcess

 

property IsOutOfProcess: Boolean read;

 

Boolean IsOutOfProcess { get; }

 

Property ReadOnly 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:

MaxSessions

 

property MaxSessions: Int32 read write;

 

Int32 MaxSessions { get; set; }

 

Property MaxSessions As Int32

OnSessionCreated    (declared in SessionManager)

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    (declared in SessionManager)

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    (declared in SessionManager)

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)

RegisterSessionManager    (declared in SessionManager)

 

class method RegisterSessionManager(manager: ISessionManager)

 

static void RegisterSessionManager(ISessionManager manager)

 

Shared Sub RegisterSessionManager(manager As ISessionManager)

Parameters:

  • manager:

ReleaseSession

 

method ReleaseSession(session: ISession)

 

void ReleaseSession(ISession session)

 

Sub ReleaseSession(session As ISession)

Parameters:

  • session:

remove_OnSessionCreated    (declared in SessionManager)

 

method remove_OnSessionCreated(value: SessionEventHandler)

 

void remove_OnSessionCreated(SessionEventHandler value)

 

Sub remove_OnSessionCreated(value As SessionEventHandler)

Parameters:

  • value:

remove_OnSessionDestroyed    (declared in SessionManager)

 

method remove_OnSessionDestroyed(value: SessionIDEventHandler)

 

void remove_OnSessionDestroyed(SessionIDEventHandler value)

 

Sub remove_OnSessionDestroyed(value As SessionIDEventHandler)

Parameters:

  • value:

remove_OnSessionExpired    (declared in SessionManager)

 

method remove_OnSessionExpired(value: SessionEventHandler)

 

void remove_OnSessionExpired(SessionEventHandler value)

 

Sub remove_OnSessionExpired(value As SessionEventHandler)

Parameters:

  • value:

SessionCount  protected

 

property SessionCount: Int32 read;

 

Int32 SessionCount { get; }

 

Property ReadOnly SessionCount As Int32

Timeout    (declared in SessionManager)

 

property Timeout: Int32 read write;

 

Int32 Timeout { get; set; }

 

Property Timeout As Int32

TriggerOnSessionCreated  protected    (declared in SessionManager)

 

method TriggerOnSessionCreated(e: SessionEventArgs)

 

void TriggerOnSessionCreated(SessionEventArgs e)

 

Sub TriggerOnSessionCreated(e As SessionEventArgs)

Parameters:

  • e:

TriggerOnSessionDestroyed  protected    (declared in SessionManager)

 

method TriggerOnSessionDestroyed(e: SessionIDEventArgs)

 

void TriggerOnSessionDestroyed(SessionIDEventArgs e)

 

Sub TriggerOnSessionDestroyed(e As SessionIDEventArgs)

Parameters:

  • e:

TriggerOnSessionExpired  protected    (declared in SessionManager)

 

method TriggerOnSessionExpired(e: SessionEventArgs)

 

void TriggerOnSessionExpired(SessionEventArgs e)

 

Sub TriggerOnSessionExpired(e As SessionEventArgs)

Parameters:

  • e:

UnregisterSessionManager    (declared in SessionManager)

 

class method UnregisterSessionManager(manager: ISessionManager)

 

static void UnregisterSessionManager(ISessionManager manager)

 

Shared Sub UnregisterSessionManager(manager As ISessionManager)

Parameters:

  • manager:

 

IsOutOfProcess

 

property IsOutOfProcess: Boolean read;

 

Boolean IsOutOfProcess { get; }

 

Property ReadOnly IsOutOfProcess As Boolean

MaxSessions

 

property MaxSessions: Int32 read write;

 

Int32 MaxSessions { get; set; }

 

Property MaxSessions As Int32

SessionCount  protected

 

property SessionCount: Int32 read;

 

Int32 SessionCount { get; }

 

Property ReadOnly SessionCount As Int32

Timeout    (declared in SessionManager)

 

property Timeout: Int32 read write;

 

Int32 Timeout { get; set; }

 

Property Timeout As Int32

GlobalSessionManager    (declared in SessionManager)

 

class property GlobalSessionManager: ISessionManager read;

 

class ISessionManager GlobalSessionManager { get; }

 

Shared Property ReadOnly GlobalSessionManager As ISessionManager

 

RegisterSessionManager    (declared in SessionManager)

 

class method RegisterSessionManager(manager: ISessionManager)

 

static void RegisterSessionManager(ISessionManager manager)

 

Shared Sub RegisterSessionManager(manager As ISessionManager)

Parameters:

  • manager:

UnregisterSessionManager    (declared in SessionManager)

 

class method UnregisterSessionManager(manager: ISessionManager)

 

static void UnregisterSessionManager(ISessionManager manager)

 

Shared Sub UnregisterSessionManager(manager As ISessionManager)

Parameters:

  • manager:

 

constructor

 

constructor

 

MemorySessionManager()

 

Sub New

constructor (Boolean)  protected

 

constructor(register: Boolean)

 

MemorySessionManager(Boolean register)

 

Sub New (register As Boolean)

Parameters:

  • register:

constructor (Boolean, Boolean)  protected    (declared in SessionManager)

 

constructor(register: Boolean; initializeSessionExpirationTimer: Boolean)

 

MemorySessionManager(Boolean register, Boolean initializeSessionExpirationTimer)

 

Sub New (register As Boolean, initializeSessionExpirationTimer As Boolean)

Parameters:

  • register:
  • initializeSessionExpirationTimer:

constructor (IContainer)

 

constructor(container: IContainer)

 

MemorySessionManager(IContainer container)

 

Sub New (container As IContainer)

Parameters:

  • container:

add_OnSessionCreated    (declared in SessionManager)

 

method add_OnSessionCreated(value: SessionEventHandler)

 

void add_OnSessionCreated(SessionEventHandler value)

 

Sub add_OnSessionCreated(value As SessionEventHandler)

Parameters:

  • value:

add_OnSessionDestroyed    (declared in SessionManager)

 

method add_OnSessionDestroyed(value: SessionIDEventHandler)

 

void add_OnSessionDestroyed(SessionIDEventHandler value)

 

Sub add_OnSessionDestroyed(value As SessionIDEventHandler)

Parameters:

  • value:

add_OnSessionExpired    (declared in SessionManager)

 

method add_OnSessionExpired(value: SessionEventHandler)

 

void add_OnSessionExpired(SessionEventHandler value)

 

Sub add_OnSessionExpired(value As SessionEventHandler)

Parameters:

  • value:

CreateNewSession  protected

 

method CreateNewSession(sessionId: Guid): ISession

 

ISession CreateNewSession(Guid sessionId)

 

Function CreateNewSession(sessionId As Guid) As ISession

Parameters:

  • sessionId:

DestroySession (Guid)    (declared in SessionManager)

 

method DestroySession(sessionId: Guid)

 

void DestroySession(Guid sessionId)

 

Sub DestroySession(sessionId As Guid)

Parameters:

  • sessionId:

DestroySession (ISession)    (declared in SessionManager)

 

method DestroySession(session: ISession)

 

void DestroySession(ISession session)

 

Sub DestroySession(session As ISession)

Parameters:

  • session:

Dispose  protected    (declared in SessionManager)

 

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    (declared in SessionManager)

 

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:
  • updateTime:

GetSession    (declared in SessionManager)

 

method GetSession(sessionId: Guid): ISession

 

ISession GetSession(Guid sessionId)

 

Function GetSession(sessionId As Guid) As ISession

Parameters:

  • sessionId:

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:

remove_OnSessionCreated    (declared in SessionManager)

 

method remove_OnSessionCreated(value: SessionEventHandler)

 

void remove_OnSessionCreated(SessionEventHandler value)

 

Sub remove_OnSessionCreated(value As SessionEventHandler)

Parameters:

  • value:

remove_OnSessionDestroyed    (declared in SessionManager)

 

method remove_OnSessionDestroyed(value: SessionIDEventHandler)

 

void remove_OnSessionDestroyed(SessionIDEventHandler value)

 

Sub remove_OnSessionDestroyed(value As SessionIDEventHandler)

Parameters:

  • value:

remove_OnSessionExpired    (declared in SessionManager)

 

method remove_OnSessionExpired(value: SessionEventHandler)

 

void remove_OnSessionExpired(SessionEventHandler value)

 

Sub remove_OnSessionExpired(value As SessionEventHandler)

Parameters:

  • value:

TriggerOnSessionCreated  protected    (declared in SessionManager)

 

method TriggerOnSessionCreated(e: SessionEventArgs)

 

void TriggerOnSessionCreated(SessionEventArgs e)

 

Sub TriggerOnSessionCreated(e As SessionEventArgs)

Parameters:

  • e:

TriggerOnSessionDestroyed  protected    (declared in SessionManager)

 

method TriggerOnSessionDestroyed(e: SessionIDEventArgs)

 

void TriggerOnSessionDestroyed(SessionIDEventArgs e)

 

Sub TriggerOnSessionDestroyed(e As SessionIDEventArgs)

Parameters:

  • e:

TriggerOnSessionExpired  protected    (declared in SessionManager)

 

method TriggerOnSessionExpired(e: SessionEventArgs)

 

void TriggerOnSessionExpired(SessionEventArgs e)

 

Sub TriggerOnSessionExpired(e As SessionEventArgs)

Parameters:

  • e:

 

OnSessionCreated    (declared in SessionManager)

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    (declared in SessionManager)

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    (declared in SessionManager)

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)