Search code examples
javascriptjqueryidle-timer

Javascript/JQuery: Want to Idle function using session


Can anyone help me in my problem?

Example:

I have 2 same page have same session the first page is idle and the another not idle but when 30mins done the first page popup to timeout a session but I'm using second page that's why no idle in 1st page because they have same session


Solution

  • This sounds mostly like what Wordpress does with the "heartbeat" api.

    You could check out how they're doing it:

    http://phpxref.ftwr.co.uk/wordpress/nav.html?wp-includes/js/heartbeat.js.source.html