Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How to redirect to home page if the user is not used for a specified time

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

I have a requirement in our application that the user is doing a transaction on the site and in the middle he goes to another website for about to 30 mins and he returns back to our page, then this time we need to close his transaction at any moment and redirect him to home page (i.e. session invalidate and redirect to home without user interaction), this will happens only after 30 mins. This should happens if he returns to our page or not, but internally we should redirect to home automatically after 30 mins time.

please someone help on this....!

thanks,
Sumant
 
Sheriff
Posts: 67620
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought I knew what you were trying to do until I got to:

Originally posted by sumant kuchipudi:
This should happens if he returns to our page or not, but internally we should redirect to home automatically after 30 mins time.

Are you saying that you want, after 30 minutes since someone logs in, to yank them back to your site even if they are browsing somewhere else?

Please tell me that's not what you meant.
[ July 01, 2008: Message edited by: Bear Bibeault ]
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
let me give clear explimation.

the user is opened 2 windows, in one window he is using our site and he is in the middle of the transaction, suddenly he got to go another site for more than 30 mins, then he oepend another window and using, after morethan 30 mins, he opened our site, then immediately we show him home page (Ex: DCU.org site).

thanks,
Sumant K
 
Bear Bibeault
Sheriff
Posts: 67620
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you are saying that, if the user returns to your site after the session has expired, he would be redirected to the login page?

If so, that's a very common requirement.

Usually, it is satisfied by employing a servlet filter. The filter is invoked prior to every protected page, and if the session token is not in the session, a redirect to the login page takes place. Upon login, the session token is created so that users can visit the protected pages. Once the sessions expires, the token is no longer available (and can be removed upon a logout action).
[ July 01, 2008: Message edited by: Bear Bibeault ]
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic