Welcome Guest, Not a member yet? Register   Sign In
redirecting and alerting after the session has cleared
#4

(This post was last modified: 01-25-2018, 12:21 PM by richb201.)

I am still fooling with the alert. I have this in a file called javascript_funcs.js

$(document).click(function(){
   if(typeof timeOutObj != "undefined") {
   clearTimeout(timeOutObj);
}

   timeOutObj = setTimeout(function(){
   localStorage.clear();
   window.location = "/";
   alert ("logoff due to inactivity");
}, 6000);   //will expire after 6 secs
});

I have it set to 6 secs just for testing. What I am finding is that unless a user clicks on item on my menu, the timer is never set. So for example a user logins in and then doesn't do anything, the click event never fires and then the logoff timer never fires.Is there some way to force the set Timer to start when the system first comes up (without a user click)?
proof that an old dog can learn new tricks
Reply


Messages In This Thread
RE: redirecting and alerting after the session has cleared - by richb201 - 01-25-2018, 12:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB