ISession

Overview

The Interface ISession interface represents a user session. Sessions are managed by classes implementing the Interface 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

Implemented in

 

Count

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

 

property Count: Int32 read;

 

Int32 Count { get; }

 

Property ReadOnly Count As Int32

Created

Gets UTC datetime when this session instance was created.

 

property Created: DateTime read;

 

DateTime Created { get; }

 

Property ReadOnly 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; }

 

Property ReadOnly Disposed As Boolean

Expired

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

 

property Expired: Boolean read;

 

Boolean Expired { get; }

 

Property ReadOnly 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; }

 

Property ReadOnly LastAccessed As DateTime

Names

Gets list of session value names.

 

property Names: ReadOnlyCollection<String> read;

 

ReadOnlyCollection<String> Names { get; }

 

Property ReadOnly 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 array of String

SessionID

Gets session Id.

 

property SessionID: Guid read;

 

Guid SessionID { get; }

 

Property ReadOnly 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; }

 

Property ReadOnly Count As Int32

Created

Gets UTC datetime when this session instance was created.

 

property Created: DateTime read;

 

DateTime Created { get; }

 

Property ReadOnly 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; }

 

Property ReadOnly Disposed As Boolean

Expired

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

 

property Expired: Boolean read;

 

Boolean Expired { get; }

 

Property ReadOnly 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; }

 

Property ReadOnly LastAccessed As DateTime

Names

Gets list of session value names.

 

property Names: ReadOnlyCollection<String> read;

 

ReadOnlyCollection<String> Names { get; }

 

Property ReadOnly 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 array of String

SessionID

Gets session Id.

 

property SessionID: Guid read;

 

Guid SessionID { get; }

 

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

See Also