runtime.Session
Object Description |
Encapsulates the user session for the currently executing script. Use this object to set and get user-defined objects for the current user session. Use the objects to track user-related session data. For example, you can gather information about the user scope, budget, or business problems. Use Session.set(options) to set session object values. Use Session.get(options) to retrieve session object values. |
Supported Script Types |
Server scripts For more information, see SuiteScript 2.x Script Types. |
Module |
|
Methods and Properties |
|
Since |
2015.2 |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/runtime Module Script Samples.
// Add additional code
...
var sessionObj = runtime.getCurrentSession(); //sessionObj is a runtime.Session object
sessionObj.set({
name: 'myKey',
value: 'myValue'
});
log.debug('Session object myKey value: ' + sessionObj.get({name: 'myKey'}));
...
// Add additional code