Modules

filter

 

Objects/Functions

module (N/runtime)

SuiteScript 2.0

Session.set(options)

{Session}.set({name: {string*},value: {string*}})

N/runtime Module
Session.set()
Method Description: Sets a key and value for a user-defined session object. Use Session.get(options) to retrieve the object value after you set it.
Returns: void
Supported Script Types: Server scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/runtime Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=Session.set(options)

Example:

// Code Example 1
// Add additional code
//...
var sessionObj = runtime.getCurrentSession();
sessionObj.set({
name: 'myKey',
value: 'myValue'
});
log.debug('Session object myKey value: ' + sessionObj.get({name: 'myKey'});
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4296667139.html