ISession

Overview

The ISession interface represents a user session. Sessions are managed by classes implementing the ISessionManager interface (f.e. MemorySessionManager class).

The Service class provides property Service that allows easy access to the session instance assotiated with the remote client application initiated the service method execution.

See the Session Management article for more details.

Location


 

Count

Gets the number of items in the session-state collection.

 

property Count: Int32 read;

 

Int32 Count { get; }

 

ReadOnly Property Count() As Int32

Created

Gets UTC datetime when this session instance was created.

 

property Created: DateTime read;

 

DateTime Created { get; }

 

ReadOnly Property Created() As DateTime

Disposed

Gets a flag indicating whether current session instance is already disposed of.

Disposed sessions can no longer be modified and they will be discarded (rather then persisted for future calls) once they get released.

 

property Disposed: Boolean read;

 

Boolean Disposed { get; }

 

ReadOnly Property Disposed() As Boolean

Expired

Gets a flag indicating whether the current session instance is expired.

 

property Expired: Boolean read;

 

Boolean Expired { get; }

 

ReadOnly Property Expired() As Boolean

Item

Gets or sets individual session values.

 

property Item[name: String]: Object read write;

 

Object Item[String name] { get; set; }

 

Property Item(name As String) As Object

LastAccessed

Gets or sets a UTC datetime when this session instance was last accessed.

 

property LastAccessed: DateTime read;

 

DateTime LastAccessed { get; }

 

ReadOnly Property LastAccessed() As DateTime

Names

Gets list of session value names.

 

property Names: ReadOnlyCollection<String> read;

 

ReadOnlyCollection<String> Names { get; }

 

ReadOnly Property Names() As ReadOnlyCollection<String>

Remove

Removes session value from the current session instance. If session doesn't contain value with provided name then it is ignored.

 

method Remove(name: String)

 

void Remove(String name)

 

Sub Remove(name As String)

Parameters:

  • name: Session value name

Roles

Gets or sets roles associated to this session.

Roles are checked when services or methods have their Roles property set in the Service Builder.

 

property Roles: array of String read write;

 

String[] Roles { get; set; }

 

Property Roles() As String()

SessionID

Gets session Id.

 

property SessionID: Guid read;

 

Guid SessionID { get; }

 

ReadOnly Property SessionID() As Guid

Timeout

Gets or sets the number of seconds since the last access that can elapse before the session will expire.

 

property Timeout: Int32 read write;

 

Int32 Timeout { get; set; }

 

Property Timeout() As Int32

Touch

Updates the LastAccessed value of the session with current date and time.

 

method Touch

 

void Touch()

 

Sub Touch()

 

Count

Gets the number of items in the session-state collection.

 

property Count: Int32 read;

 

Int32 Count { get; }

 

ReadOnly Property Count() As Int32

Created

Gets UTC datetime when this session instance was created.

 

property Created: DateTime read;

 

DateTime Created { get; }

 

ReadOnly Property Created() As DateTime

Disposed

Gets a flag indicating whether current session instance is already disposed of.

Disposed sessions can no longer be modified and they will be discarded (rather then persisted for future calls) once they get released.

 

property Disposed: Boolean read;

 

Boolean Disposed { get; }

 

ReadOnly Property Disposed() As Boolean

Expired

Gets a flag indicating whether the current session instance is expired.

 

property Expired: Boolean read;

 

Boolean Expired { get; }

 

ReadOnly Property Expired() As Boolean

Item

Gets or sets individual session values.

 

property Item[name: String]: Object read write;

 

Object Item[String name] { get; set; }

 

Property Item(name As String) As Object

LastAccessed

Gets or sets a UTC datetime when this session instance was last accessed.

 

property LastAccessed: DateTime read;

 

DateTime LastAccessed { get; }

 

ReadOnly Property LastAccessed() As DateTime

Names

Gets list of session value names.

 

property Names: ReadOnlyCollection<String> read;

 

ReadOnlyCollection<String> Names { get; }

 

ReadOnly Property Names() As ReadOnlyCollection<String>

Roles

Gets or sets roles associated to this session.

Roles are checked when services or methods have their Roles property set in the Service Builder.

 

property Roles: array of String read write;

 

String[] Roles { get; set; }

 

Property Roles() As String()

SessionID

Gets session Id.

 

property SessionID: Guid read;

 

Guid SessionID { get; }

 

ReadOnly Property SessionID() As Guid

Timeout

Gets or sets the number of seconds since the last access that can elapse before the session will expire.

 

property Timeout: Int32 read write;

 

Int32 Timeout { get; set; }

 

Property Timeout() As Int32

 

Remove

Removes session value from the current session instance. If session doesn't contain value with provided name then it is ignored.

 

method Remove(name: String)

 

void Remove(String name)

 

Sub Remove(name As String)

Parameters:

  • name: Session value name

Touch

Updates the LastAccessed value of the session with current date and time.

 

method Touch

 

void Touch()

 

Sub Touch()