-
Notifications
You must be signed in to change notification settings - Fork 79
How this Plugin Works
This is the basic function of the plugin at its default settings. The plugin is highly configurable: please read the Public Configuration Variables page for information on how to customize the plugin for your usage.
####BASIC FUNCTION
When the user is active, the plugin sets a variable, idleTimerLastActivity
, with the current time. The value of this variable is available on all windows and tabs within the site.
At regular intervals (2 seconds by default), the plugin compares the idleTimerLastActivity
time to the current time.
If the difference between the two times is greater than the permitted 'inactivity limit', idleTimeLimit
, the user has been idle too long: a warning message appears on all windows and tabs informing the user of impending logout.
If the user remains inactive, all windows and tabs redirect to the site's "You've Been Logged Out!" page.
####DEEPER UNDERSTANDING The best way to understand how the idleTimeout script works is to load the jquery-idleTimeout-for-testing.js on your site, and watch the console debug log. One way to do this is to use Mozilla Firefox with the Firebug web developer addon: http://getfirebug.com/
Jquery-idleTimeout-for-testing.js includes iframe functionality and is heavily commented. You can learn quite a bit just by reading the code.