Need a common Portal page that always reloads/refreshes so we can display an idle session timeout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2023 05:15 PM
We have received feedback from our users that when using ServiceNow's portal (Employee Center), if the session times out, the site may appear "dead" to the user (e.g. typing in search box does nothing). If the user clicks a link or refreshes the page, they are re-authenticated automatically through SSO. Unfortunately, we get enough user feedback (5-10 users per week) that we decided to implement an idle session dialogue. In the Next Experience UI, this already occurs, but does not in Portal.
I created a widget containing a modal, and placed it in the header at first. Unfortunately this causes the modal to seize the entire screen, including the modal itself. I moved the widget to the footer, and this works great, EXCEPT...
The footer doesn't refresh/reload as the user clicks around the portal site.
The way I built this was simple. When the widget loads, a 60-minute countdown starts. When the countdown hits zero, the modal dialogue appears, and the user clicks the Refresh button, reauthenticating through SSO and avoiding the "dead site" experience.
The thought was that as the user clicks around the site, the footer would reload/refresh and the counter would start over. As long as the user was active, the counter wouldn't reach zero. But the footer doesn't actually reload, so the user will receive the timeout message even if they're very active on the site.
The Portal header and footer are "common" components. No matter what page the user loads in the portal site, those are always present, making them seem to be ideal to put a session timeout widget. However, I need a common component/page that always refreshes as the user navigates the site. The only other alternative is to embed the timeout widget on every single page in our portal.
Is anyone able to suggest a good place to tuck such a widget?
If your thought is to have a widget periodically "ping" the server, that won't work, as the session would stay alive indefinitely and our information security team won't allow that. Sessions need to expire after 60 minutes of inactivity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2023 08:36 PM
Hi @Matt S6 ,
ServiceNow default Apache session timeout can be overwritten by doing either of the following:
- Adding the glide.ui.session_timeout system property (for more information.
- Installation Exit customizations for SAM instances (for more information, see Login Modifications in Installations Exits)
After customizing the ServiceNow session timeout on a SAML-enabled instance, users do not receive any type of warning. The screen does not respond and there is no change in the UI. In some cases, users receive a blank white page in the main content frame or a browser error about not being able to display the content for that frame.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2023 06:27 AM
Hi @Community Alums ,
I appreciate the feedback. Unfortunately, we already have the session timeout set to 60 minutes (default per product docs is 20 minutes). We *want* to show a warning to the user that their session has timed out, which is why I was hoping to find a page that persists across the Employee Center Portal but also "refreshes" each time the user performs an action (e.g. search, clicks a link, navigates, etc.) so that the timer will reset.
Matt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2023 08:34 AM - edited ‎05-09-2023 08:35 AM
Hi @Matt S6
You can have onclick event listener on the document object, so whenever user click anywhere reset the timer and refresh the session.
Regards,
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2023 10:02 AM
Hi @surajp
This wouldn't require DOM manipulation? I know that ServiceNow frowns upon accessing some DOM objects like document or window. Would attaching a listener to the document object do this? Also, I don't want to capture every onClick event, only those that would result in an opening of a server connection. Clicking links, performing searches, etc. would do this. Just a click on a page (e.g. highlighting/copying some text) wouldn't open a server connection so the session could still, in theory, time out.
Kindest regards,
Matt