Session Timeout Warning Popup for Multiple Tabs

Demo

Click here to view the demo

Description

A javascript function for displaying a session timeout warning popup before a user times out in an application.  Below are some highlights of it’s functionality:

  • Will only display one warning popup even if a user has multiple tabs for the application open
  • As a user browses in one tab it will reset the warning popup countdown in all other tabs so they are synchronized
  • Can display a countdown in each tab’s title area of how much time is left before the warning popup
  • Easily configure times, cookie names, URLs, and messaging.

How To Use

Download

Configure

Option Type Default Value
iSecondsTillWarning Integer 15
iSecondsTillRedirect Integer 10
sShowCountdownCookieName String TimeoutWarningDisplay
sLastAccessTimeCookieName String TimeoutWarningLastAccessTime
sWarningURL String warning.html
sLogoutURL String logout.html
sPopupBlockedMessage String Your browser blocked a popup trying to warn you that your session is about to time out. Disable your popup blocker for this site so you can receive the warning popup next time.

App Pages

Example: home.aspx

The actual pages of the app that need a warning popup.

<script>
var oSessionTimeoutWarning = new SessionTimeoutWarning();
oSessionTimeoutWarning.StartTimeoutWarningTimer(true);
</script>

Warning Popup

Example: warning.html

The warning popup page that will give the user the ability to continue their session or will redirect all of their app tabs to the logout page.  This page needs to be an html page so that it does not affect the app’s actual session.

<script>
var oSessionTimeoutWarning = new SessionTimeoutWarning();
oSessionTimeoutWarning.StartTimeoutRedirectTimer();
</script>

Continue Page

Example: continue.aspx

The continue page that resets their session clock.  This needs to be an app page that affects the app’s actual session so it gets reset.

<script language=”javascript”>
window.opener.oSessionTimeoutWarning.StartTimeoutWarningTimer(false);
window.close();
</script>

Advertisements
Leave a comment

8 Comments

  1. buyan

     /  June 13, 2013

    HI Kyle,
    I tried using this timer on a visual force page on a force.com site and i ran into a lot of issues. Could you help me if i can give you a quick call?

    Reply
  2. HI Kyle, I was able to use your technique in our existing timeout module and it’s working swimmingly.

    Reply
  3. anil

     /  August 23, 2014

    timer is not showing in title part , In chrome & firefox

    Reply
  4. Sri

     /  January 20, 2015

    hi kyle
    i tried downloading the js file but cant download it can you mail me the session timeout js to the following email

    Reply
  5. Great article and code; also working as expected.
    I will be using this…

    Reply
  6. Priya

     /  February 28, 2016

    Hi Kyle,I tried downloading the js file but cant download the same, would it possible for you to email the same to the following email? Thanks!

    Reply
  7. Kavya

     /  March 18, 2016

    Hi Kyle,

    i tried downloading the js file but can’t download it.. Can you mail me the session timeout js to the following email.

    Thanks.

    Reply
  8. Saravana

     /  March 1, 2017

    Hi Kyle,

    I am not able to access the video/download link and getting 404. Can you please send it to me in mail?

    Saravana

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: