aspose file tools*
The moose likes JSP and the fly likes How to redirect to home page if the user is not used for a specified time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to redirect to home page if the user is not used for a specified time" Watch "How to redirect to home page if the user is not used for a specified time" New topic
Author

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

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
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


Thanks,
Kumar
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61419
    
  67

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
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

Joined: Jan 10, 2002
Posts: 61419
    
  67

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to redirect to home page if the user is not used for a specified time