glidesession
GlideSession is often confused, for me at least, with gs
. You need to
make a gs
call to get the session, but the session itself has very
specific functions that can be really useful. Below I go over those.
Here's a link to the
docs.
Property / Method | Scoped | Global |
---|---|---|
clearClientData | Global | |
getClientData | Scoped | Global |
getClientIP | Scoped | |
getCurrentApplicationId | Scoped | |
getLanguage | Scoped | Global |
getSessionToken | Scoped | |
getRoles | Global | |
getTimeZoneName | Scoped | Global |
getUrlOnStack | Scoped | |
isImpersonating | Scoped | Global |
isInteractive | Scoped | |
isLoggedIn | Scoped | Global |
putClientData | Scoped | Global |
\<!--
GlideSession
Property/Method | Description |
---|---|
getTimeZoneName | Get the Time Zone name associated with the user |
putClientData | Store a value in an active session |
getLanguage | Language used by the user |
getUrlOnStack | Gets the current URI for the session |
getClientData | Fetch the value in active session based on the name |
isInteractive | Checks if the current session is interactive |
getClientIP | Gets the client IP address |
isLoggedIn | Determines if the current user is currently logged in |
getCurrentApplicationId | Gets the ID of current application, defined as a user preference and set by the application picker |
--
clearClientData
Clears a session client value previously set with putClientData().
This method is used in a client script to clear data values that were set by a server script using the putClientData() method.
getClientData
Gets a session client value previously set with putClientData().
This method is used in a client script to retrieve data values that were set by a server script that used the putClientData() method.
getClientIP
Returns the client IP address.
getCurrentApplicationId
Returns the application currently selected in the application picker.
This method requires admin privileges.
getLanguage
Gets the session's language code.
getSessionToken
Returns the session token.
getRoles
Gets a list of roles for the current user.
The list of roles does not reflect any changes made during the current user session. To get the updated list of roles, the user must log out and log back in.
getTimeZoneName
Gets the name of the session's time zone.
getUrlOnStack
Returns the URL on the stack. Returns null if the stack is empty.
isImpersonating
Returns true if the user is impersonating another user.
isInteractive
Determines if the current session is interactive.
An interactive session is one that involves an end-user interacting with a user interface that then retrieves information from a server. An example of this type of session is when a user logs in using the log-in screen or uses a form to query a data store. A non-interactive session is one that only involves programmatic interaction with a server such as a SOAP request to retrieve data.
isLoggedIn
Determines if the current user is currently logged in.
putClientData
Sets a session client value that can be retrieved with getClientData(). This method is used in a server side script that runs when a form is created.