https://github.com/ocombe/jquery-keepalive
A jQuery plugin to keep a php session alive
https://github.com/ocombe/jquery-keepalive
Last synced: over 1 year ago
JSON representation
A jQuery plugin to keep a php session alive
- Host: GitHub
- URL: https://github.com/ocombe/jquery-keepalive
- Owner: ocombe
- Created: 2011-02-17T17:49:15.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-02-17T18:59:46.000Z (over 15 years ago)
- Last Synced: 2024-10-12T08:19:52.003Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 91.8 KB
- Stars: 16
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
jQuery keepAlive plugin
https://github.com/Aldri/jQuery-keepAlive
Copyright 2011, Olivier Combe
Dual licensed under the MIT or GPL Version 2 licenses.
http://jquery.org/license
Version 1.0 2011-02-17
* Description :
This plugin does a simple ajax call to an url every x minutes (10 minutes by default).
The goal is to force the server to refresh the user's session timeout in order to keep it alive for as long as the user is on your web site.
* Usage :
Add the js file (jquery.keepAlive.js or jquery.keepAlive.min.js) and the php file (keepAlive.php) in your folder.
Include the js file in your page and call the function :
$.fn.keepAlive();
* Options :
You can set the url of your php file :
$.fn.keepAlive({url: 'somefolder/keepAlive.php'});
You can set the timer of the ajax calls :
$.fn.keepAlive({timer: 5000}); // call every 5 seconds
Or you can set both :
$.fn.keepAlive({url: 'somefolder/keepAlive.php', timer: 5000}); // call every 5 seconds
If you want to stop the ajax calls for some reason just call :
$.fn.keepAlive('stop');