OpenPetra
Free Administration Software for Non-Profits
Ict.Common.Session.TSession Class Reference

Static class for storing sessions. we are using our own session handling, since we want to store sessions in the database, and we want to run tests without HttpContext. More...

Static Public Member Functions

static void InitThread (string AThreadDescription, string AConfigFileName, string ASessionID=null)
 Set the session id for this current thread. Each request has its own thread. Threads can be reused for different users. More...
 
static void SetVariable (string name, object value)
 set a session variable. store to database immediately More...
 
static void ClearVariables (string ANameStartsWith)
 remove all variables that start with a name, eg. PROGRESSTRACKER More...
 
static bool HasVariable (string name)
 returns true if variable exists and is not null More...
 
static object GetVariable (string name)
 get a session variable More...
 
static TVariant GetVariant (string name)
 get a session variable, not decoded yet More...
 
static void RefreshFromDatabase ()
 get the session values from the database again More...
 
static string GetSessionID ()
 get the session id, to pass to a sub thread More...
 
static void CloseSession ()
 close the current session More...
 

Detailed Description

Static class for storing sessions. we are using our own session handling, since we want to store sessions in the database, and we want to run tests without HttpContext.

Member Function Documentation

◆ ClearVariables()

static void Ict.Common.Session.TSession.ClearVariables ( string  ANameStartsWith)
inlinestatic

remove all variables that start with a name, eg. PROGRESSTRACKER

◆ CloseSession()

static void Ict.Common.Session.TSession.CloseSession ( )
inlinestatic

close the current session

◆ GetSessionID()

static string Ict.Common.Session.TSession.GetSessionID ( )
inlinestatic

get the session id, to pass to a sub thread

◆ GetVariable()

static object Ict.Common.Session.TSession.GetVariable ( string  name)
inlinestatic

get a session variable

Parameters
name
Returns

◆ GetVariant()

static TVariant Ict.Common.Session.TSession.GetVariant ( string  name)
inlinestatic

get a session variable, not decoded yet

Parameters
name
Returns

◆ HasVariable()

static bool Ict.Common.Session.TSession.HasVariable ( string  name)
inlinestatic

returns true if variable exists and is not null

Parameters
name
Returns

◆ InitThread()

static void Ict.Common.Session.TSession.InitThread ( string  AThreadDescription,
string  AConfigFileName,
string  ASessionID = null 
)
inlinestatic

Set the session id for this current thread. Each request has its own thread. Threads can be reused for different users.

◆ RefreshFromDatabase()

static void Ict.Common.Session.TSession.RefreshFromDatabase ( )
inlinestatic

get the session values from the database again

◆ SetVariable()

static void Ict.Common.Session.TSession.SetVariable ( string  name,
object  value 
)
inlinestatic

set a session variable. store to database immediately

Parameters
name
value

The documentation for this class was generated from the following file: