Session Timeout in plain jQuery
jquery
Solution
You could on all modern browsers capture mousemove event:
(function () {
var timeoutSession;
document.addEventListener('mousemove', function (e) {
clearTimeout(timeoutSession);
timeoutSession = setTimeout(function () {
alert('Make SESSION expire');
//call a script here to server...
}, 30000); //30s
}, true);
})();
Problem
How can I write sessionTimeOut functionality in plain jQuery without using any pluging? I want to use my own alert ui.To figure out any UI activity I can write but not sure how to combine it in a timeout functionality. ``` $('*').on('click', function () { console.log('click', this); }); $('*').on('change', function() { console.log('change', this); }); ```