TROSession

Overview

The TROSession class represents an individual user session within the Session Management system of Remoting SDK.

Use Cases

You will usually work with this class via the TRORemoteDataModule.Session property to access the current user's session.

Location

 

constructor Create  virtual

Creates a new instance.

constructor Create(const aSessionID: TGUID)

Parameters:

  • aSessionID: Session ID

Count

Returns the number of Values contained in the session.

property Count: integer read write

Created

Returns the date and time when the session was originally created.

property Created: TDateTime read write

GetKeys  protected virtual

function GetKeys: TROSessionKeys

Keys

property Keys: TROSessionKeys read write

LastAccessed

Holds the date and time when the session was last accessed. This value will be used in combination with the session manager's SessionDuration property to determine if a session has expired.

property LastAccessed: TDateTime read write

LoadFromStream  virtual

Loads data from stream.

procedure LoadFromStream(aStream: TStream; OnlyValues: boolean)

Parameters:

  • aStream: Stream
  • OnlyValues: Loads name=value pair only

Remove

Removes specified value from session

procedure Remove(const Name: string)

Parameters:

  • Name: name

Roles

This property gives access to the roles associated to this session; these are checked when services or methods have their Roles property set in the Service Builder.

property Roles: TStringArray read write

SaveStruct

Allows to save struct to session

procedure SaveStruct(aStruct: TROComplexType)

Parameters:

  • aStruct: struct

SaveToStream  virtual

Saves Session to stream

procedure SaveToStream(aStream: TStream; OnlyValues: boolean)

Parameters:

  • aStream: Stream
  • OnlyValues: Saves name=value pair only

SessionID

Contains the ID that uniquely identifies the session, and matches the ClientID received from the user.

property SessionID: TGUID read write

Values

This indexer property gives access to the values stored in the session by name.

property Values[Name: string]: Variant read write

 

Count

Returns the number of Values contained in the session.

property Count: integer read write

Created

Returns the date and time when the session was originally created.

property Created: TDateTime read write

Keys

property Keys: TROSessionKeys read write

LastAccessed

Holds the date and time when the session was last accessed. This value will be used in combination with the session manager's SessionDuration property to determine if a session has expired.

property LastAccessed: TDateTime read write

Roles

This property gives access to the roles associated to this session; these are checked when services or methods have their Roles property set in the Service Builder.

property Roles: TStringArray read write

SessionID

Contains the ID that uniquely identifies the session, and matches the ClientID received from the user.

property SessionID: TGUID read write

Values

This indexer property gives access to the values stored in the session by name.

property Values[Name: string]: Variant read write

 

constructor Create  virtual

Creates a new instance.

constructor Create(const aSessionID: TGUID)

Parameters:

  • aSessionID: Session ID

GetKeys  protected virtual

function GetKeys: TROSessionKeys

LoadFromStream  virtual

Loads data from stream.

procedure LoadFromStream(aStream: TStream; OnlyValues: boolean)

Parameters:

  • aStream: Stream
  • OnlyValues: Loads name=value pair only

Remove

Removes specified value from session

procedure Remove(const Name: string)

Parameters:

  • Name: name

SaveStruct

Allows to save struct to session

procedure SaveStruct(aStruct: TROComplexType)

Parameters:

  • aStruct: struct

SaveToStream  virtual

Saves Session to stream

procedure SaveToStream(aStream: TStream; OnlyValues: boolean)

Parameters:

  • aStream: Stream
  • OnlyValues: Saves name=value pair only

See Also