

- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
06-19-2023 08:55 AM - edited 06-19-2023 08:57 AM
Understanding User Session Object Lifecycle
I've been covering ServiceNow topics like: application nodes, user transactions/queues and so on. To add to that stream of topics and paint a higher level picture regarding a user's session, here is the lifecycle of a user session object.
When a user accesses the instance, there is a process that checks if there is an active user session or not. If not, the user is directed to an arbitrary application node and then the user's session object is created on that node, else if there is an active session found, the user continues on the node they were on previously, thus using the same user session object.
As the user works within the instance and conducts various transactions, those transactions are sent to the node that holds their session object. This is a concept known as "session affinity". If the platform didn't associated the object with a specific node, there'd have to be several sessions created for each node which isn't efficient.
Once the user logs out of the instance or their session is timed out (default is 30 minutes for interactive users and 1 minute for integrations) and they're forced out, their session object is destroyed and that memory is then freed up. Once the user accesses the instance again, the cycle repeats.
During the user's session, you can use the GlideSession API to access specific pieces of information about that user or even store specific pieces of information within their session: https://developer.servicenow.com/dev.do#!/reference/api/utah/server_legacy/c_GlideSessionAPI#r_Glide...
If you enjoy ServiceNow content like this, please consider subscribing to my ServiceNow focused YouTube channel: Allenovation!
- 1,329 Views