Background. This plugin sends ajax requests to the server at configurable
intervals to keep a PHP session from expiring.
Limitations. none.
How to use this demonstration. jQuery.keepalive is started automatically.
The default interval for contacting the server is 5-minutes. Since keepalive does no error checking
on the ajax request (in order to keep keepalive as unobtrusive as possible), the 5-minute interval allows 2
failed keepalive connections in a row while still maintaining a 20-minute contact interval—which
keeps most PHP sessions from expiring. For debugging purposes you can toggle a status display which is appended
to the body element (The toggle option below relays the status display just to the right of the button).
(Your browser appears to have cookies disabled. Session cookies are required for
the keepalive plug-in.)
Select an option...
jQuery.keepalive dependencies:
requires jQuery v1.4; there are no other dependencies.
jQuery.keepalive usage:
jQuery.keepalive is started automatically when the plug-in is included a page.
$.keepalive.configure( config )
where config is an object containing keepalive options.
$.keepalive.stop() // stop the keepalive interval timer
$.keepalive.start( config ) // start the keepalive interval timer
where config is an optional object containing keepalive options.
$.keepalive.toggleDisplay() // toggle the keepalive status display
the status display is appended to the body element
jQuery.keepalive options (type) [ default value ]: