Skip to content
JillElaine edited this page Apr 11, 2015 · 24 revisions

###WIKI PAGES Please read all the jquery-idleTimeout Wiki Pages. Note the wiki navigation on the right.

###WHY USE THIS PLUGIN Websites that track the 'idleness' (inactivity) of a user should track the user's activity within all the user's open windows and tabs.

Imagine the situation where a user has several tabs open. And because of inactivity on one of the tabs, the user is forcibly 'logged out' of the entire site: the user's 'logged in' cookie is deleted.

Meanwhile, the user (who is not aware of the forcible logout) is busily working on a complex online form on a different tab within the same site. When this poor user finishes the form, it cannot be submitted because the user has been logged out! Arrgh!

To prevent this situation, all the user's open windows and tabs within the same site must stay in synch. A user's activity on any window or tab within the site must be tracked.

If the user is truly inactive everywhere within the site, a warning notice should appear on all windows and tabs before the forcible logout of the user.

This plugin keeps a site's windows and tabs in synch thanks to another plugin, store.js.

###USAGE Dependencies

Choose the best jquery-idleTimeout script for your situation. Load the three scripts listed above before you load one of the jquery-idleTimeout scripts. You may choose to load JQuery core and JQuery UI from Google's Hosted Libraries.

Next call the jquery-idleTimeout script in a 'document ready' function. Set the jquery-idleTimeout configuration variable, 'redirectUrl', to your site's logout page. This is the only variable you must set: all other variables may be left at their default values.

Example 'document ready':

  $(document).ready(function () {
    $(document).idleTimeout({
      redirectUrl:  '/logout' // redirect to this url. Set this value to YOUR site's logout page.
    });
  });

Information on all the public configuration variables here: https://github.com/JillElaine/jquery-idleTimeout/wiki/Public-Configuration-Variables

To create a demo test page on your site, copy & paste the example.html code into a page on your site. https://github.com/JillElaine/jquery-idleTimeout/blob/master/example.html

###PROBLEMS? Please read the GENERAL TROUBLESHOOTING and IFRAMES INFORMATION & TROUBLESHOOTING pages.

###REQUEST FOR INPUT If you have a suggestion, question or problem, please submit an issue or send an email. Your feedback helps to improve this plugin!

Clone this wiki locally