Session Object (Business Rules Scripting)
This is a Data Abstract Scripting API topic
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 RemObjects SDK and Data Abstract.
The code snippet below shows how the session object can be used:
function beforeProcessDelta(delta)
{
log('session.roles ='+session.roles);
session.AddRole('SpecifiedRole');
session.RemoveRole('SpecifiedRole');
log('session.timeout ='+session.timeout);
session['CustomVariable'] = 100;
}
Members
| id |
|---|
|
Represents the session ID (GUID). This field uniquely identifies the remote user.
|
| expired |
|
If set, the session is already expired; this should only be true after logout calls.
|
| isNew |
|
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 |
|
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.
|
| available |
|
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.
|
| roles |
|
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 RemObjects SDK and Data Abstract calls.
|
| function addRole(role) |
|
Adds a new role.
|
| function removeRole(role) |
|
Removes a role.
|
| function hasRole(role) |
|
Returns true if the session contains that role. |
See Also
- Data Abstract Scripting API
- Schema – SchemaCommand – SchemaDataTable – SchemaRelationship – SchemaUpdateRule
- SchemaColumnMapping – SchemaField – SchemaParameter – SchemaSQLStatement – SchemaUnionSourceTable

Product: RemObjects Data Abstract
Available Editions: Data Abstract for .NET, Xcode, Delphi, Java and JavaScript