Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic