is it possible to redirect to login page when timeout occurs without waiting for the user to click on anything first?
Right now, when timeout occurs, the page user was on still displays but as soon as user clicks on anything it goes to login page.
Thanks.
is it possible to redirect to login page when timeout occurs without waiting for
Share
You need to check on the client side if the session has expired. The easiest way is to simply start a countdown (as long as the timeout) using javascript when the page has been loaded. When it expires, send the user to the login page. Or maybe better: just let the user know that the session has expired, because maybe he wouldn’t be too happy if you just send him somewhere. Although my online banking software does exactly that, but for security reasons, of course.
Here’s a very simple example: http://jsfiddle.net/39Sj6/1/
(In jsfiddle you won’t be redirected to google as this is forbidden by jsfiddle, but in principle it would work)