Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

redirecting from idle pages

  • 01-08-2006 10:02AM
    #1
    Registered Users, Registered Users 2 Posts: 1,305 ✭✭✭


    hi
    i'm trying to get a jsp page to redirect back to a login page if the current page they are on has been left idle for 10 minutes.

    any suggestions?
    Thanks.


Comments

  • Registered Users, Registered Users 2 Posts: 1,071 ✭✭✭Art_Wolf


    Why not just include a basic meta refresh?

    <meta http-equiv="refresh" content="600;url=http://www.blah.com/login.jsp"&gt;


  • Moderators, Society & Culture Moderators Posts: 9,688 Mod ✭✭✭✭stevenmu


    Won't that redirect after 10 minutes even if not idle ?


    The way I'd handle it with ASP, and I'm sure there's a similar JSP equivelent, is to have sessions time out after 10 minutes. Set a session variable somewhere along the line and then check on each page if it's still set (or better yet put the check in an include file that each relevant page can include), redirect if not. If you store any user details in session variables already, this is ideal. On each page (or your include file) you just check if you have a validly logged in user, if not redirect to the login page, this also then means that only logged in users can access your pages and it's easily extended to cover rights based access.

    Of course it does mean that it won't redirect after 10 minutes untill there is some navigation action by a user.


    edit: Actually thinking about it now, you may already be doing what I suggest and you're looking for a way to have it automatically redirect without user interaction ?


Advertisement