The JSMA session provides functionality for handling sessions
What can JSMA session do for me?It makes session handling easier by wrapping native JavaSript session handling methods |
Here is an example on how to write data to a JSMA session:
... session.set('username', 'IKONA-Admin') ... |
Here is an example on how to read data from a JSMA session:
... var username = session.get('username'); ... |
The JSMA session provides the following methods:
Returns the value of key as string or null if no value is set under the key.
... var username = session.get('username'); ... |
The key to be looked up in the flexAttributes of the session.
Returns a boolean value depending on whether key is present for the current session
... if (session.has('username') === true) { ... } ... |
The key to be checked in the flexAttributes of the session.
Returns the id of the current session
... var sessionId = session.id; ... |
Allows you to switch between different sessions.
... var searchedSession = session.pickup('baae790b7d53db6972fd20c679a9810c'); ... |
The desired new session ID.
Sets the value of a specified key for the current session.
... session.set('username', 'IKONA-Admin') ... |
The key to be set in the flexAttributes of the session.
The value to be set for the key
Locks the currents session for a given time "duration" in seconds. The given function is executed while the lock is active
... session.withLock(30, function { ... }) ... |
The duration in seconds
The function that is processed within the lock