Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/travishorn/jquery-sessiontimeout
After a set amount of time, a dialog is shown to the user with the option to either log out now, or stay connected. If log out now is selected, the page is redirected to a logout URL. If stay connected is selected, a keep-alive URL is requested through AJAX. If no options is selected after another set amount of time, the page is automatically redirected to a timeout URL.
https://github.com/travishorn/jquery-sessiontimeout
Last synced: about 5 hours ago
JSON representation
After a set amount of time, a dialog is shown to the user with the option to either log out now, or stay connected. If log out now is selected, the page is redirected to a logout URL. If stay connected is selected, a keep-alive URL is requested through AJAX. If no options is selected after another set amount of time, the page is automatically redirected to a timeout URL.
- Host: GitHub
- URL: https://github.com/travishorn/jquery-sessiontimeout
- Owner: travishorn
- License: mit
- Created: 2012-02-02T18:29:19.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2020-04-07T23:03:46.000Z (over 4 years ago)
- Last Synced: 2024-04-14T11:56:23.640Z (9 months ago)
- Language: JavaScript
- Homepage: http://travishorn.github.com/jquery-sessionTimeout
- Size: 27.3 KB
- Stars: 52
- Watchers: 8
- Forks: 71
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# sessionTimeout
[![Build Status](https://api.travis-ci.org/travishorn/jquery-sessionTimeout.png)](https://travis-ci.org/travishorn/jquery-sessionTimeout)---
## ⚠️ NOTICE
This is an older version. The new version is a complete re-write with no dependencies. See
[the new version here](https://github.com/travishorn/session-timeout).---
## Description
After a set amount of time, a dialog is shown to the user with the option to either log out now, or stay connected. If log out now is selected, the page is redirected to a logout URL. If stay connected is selected, a keep-alive URL is requested through AJAX. If no options is selected after another set amount of time, the page is automatically redirected to a timeout URL.## Usage
1. Include jQuery
2. Include jQuery UI (for dialog)
3. Include jquery.sessionTimeout.js
4. Call `$.sessionTimeout();` after document ready## Options
**message**
Text shown to user in dialog after warning period.
Default: 'Your session is about to expire.'**keepAliveUrl**
URL to call through AJAX to keep session alive. This resource should do something innocuous that would keep the session alive, which will depend on your server-side platform.
Default: '/keep-alive'**keepAliveAjaxRequestType**
How should we make the call to the keep-alive url? (GET/POST/PUT)
Default: 'POST'**redirUrl**
URL to take browser to if no action is take after warning period.
Default: '/timed-out'**logoutUrl**
URL to take browser to if user clicks "Log Out Now".
Default: '/log-out'**warnAfter**
Time in milliseconds after page is opened until warning dialog is opened.
Default: 900000 (15 minutes)**redirAfter**
Time in milliseconds after page is opened until browser is redirected to redirUrl.
Default: 1200000 (20 minutes)**appendTime**
If true, appends the current time stamp to the Keep Alive url to prevent caching issues
Default: true## Links
* [Online Demo](http://codepen.io/anon/pen/qEzNpd)
* [Screenshots](https://sites.google.com/site/tpopsjqueryplugins/sessiontimeout/screenshots)