The Session Object gives access to the current users session object. The default indexer gives access to the values in the session. The session object can be used to store extra data with a specific user between requests, and is used to handle roles and authentication in the Remoting SDK and Data Abstract.
The code snippet below shows how the session object can be used:
session['CustomVariable'] = 100;
Represents the session
ID (GUID). This field uniquely identifies the remote user.
If set, the session is already expired; this should only be true after logout calls.
If set, this session is a newly created one (in this request), generally from login requests this is true, or when this user does his first request.
Timeout of this session in seconds. If no calls from this client arrive at the server for "timeout" seconds since it's last used, the session is automatically destroyed.
Returns true if there is a session at all. Clients and servers without a session manager will have this set to false; if it's false all other calls will fail.
Gets or sets all roles associated with this session, separated by a comma. Roles are simple identifiers and are used to block or grant access to Remoting SDK and Data Abstract calls.
Adds a new role.
Removes a role.
Returns true if the session contains that role.