I am trying to make an auto-logout on inactivity using JavaScript. The thing is even when I move my mouse and rapidly press any key the timer does not reset.
var timeOut;
function reset() {
window.clearTimeout(timeOut);
timeOut = window.setTimeout( "redir()" , 5000 );
}
function redir() {
window.location = "index.php?page=Logout";
}
window.onload = function() { setTimeout("redir()" , 5000 ) };
window.onmousemove = reset;
window.onkeypress = reset;