Welcome Guest, Not a member yet? Register   Sign In
Session expired when computer is in idle
#4

[eluser]boltsabre[/eluser]
Quote: And it will automatically redirect the page for viewing the login form.
Did you want so that it really does automatically redirect them? So, let's say I'm on a page, leave my computer for 45 minutes, come back, what should I see? The same page, or the login page?

If the latter you'll have to use javascript. You'd want to have a site wide function (so, put it in a file which is called from every page, or whatever tickles your fancy). On page load, it starts a timer for 30 minutes, when that's expired use JS to redirect to your login page. You'd have to put in some even listeners, and each time an event is fired you'd have to reset/restart the timer (event listeners you'd be interested in would be mousemove on the body tag, focus, keypress and perhaps a couple others).

However... I really wouldn't recommend it. What if I fill out a form, and just before I submit it get a knock at the door... I leave the computer, come back and hey, WFT, where has my form gone? Now I have to find it, fill it all out again, etc.

A better idea, for pages with forms, would be to make some kind of modal box appear on the screen alerting them that their session has expired and that they should either copy their form data or login back into the site, in a DIFFERENT browser tab!


Messages In This Thread
Session expired when computer is in idle - by El Forum - 03-13-2013, 10:42 PM
Session expired when computer is in idle - by El Forum - 03-14-2013, 01:04 AM
Session expired when computer is in idle - by El Forum - 03-14-2013, 01:10 AM
Session expired when computer is in idle - by El Forum - 03-14-2013, 09:51 AM
Session expired when computer is in idle - by El Forum - 03-14-2013, 07:36 PM
Session expired when computer is in idle - by El Forum - 03-15-2013, 05:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB