• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Forward after a particular time

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I have a scenario. I am running a Timer upon user login in my web app. The user can freely browse the website after logging in succesfully. However, after a particular time has been passed (which is configurable), say 20 minutes, the user should be redirected to a security question page for security purposes. The current page of the user should be vanished and the security question page should appear. Is there a neat solution for this? I am using RequestDispatcher.forward for my responses.

Regards,
Murad.
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could store the login time as a session variable and compare it to the current time when the user requests a page.

I do not think there is any way for the web server to initiate an HTTP conversation with the browser and tell it to do something, (such as go to a different page). I think that the client has to initiate all conversations with the server. Using JavaScript, you could require all pages to refresh themselves every few minutes, which would allow the logic from my first paragraph to get control and redirect if necessary. Of course, the user could always disable JavaScript.

You can never stop people from viewing content and saving it off locally to be viewed for as long as they wish. Your best bet is to do your redirect if the user requests a new page after your specified interval.

Hope that helps.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic