aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Close or redirect after inactivity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Close or redirect after inactivity" Watch "Close or redirect after inactivity" New topic
Author

Close or redirect after inactivity

Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
I am looking for help on redirecting or closing the session after certain minutes of inactvity on client side. My code is all HTML based so makes sense to implement this using Javascript. Any clues?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
easiest way is to do this:


It will redirect the user after a set time. This could also be done with Meta Tags. You can also develop a function that detetcs user interaction and resets the timer, but that is a little more advanced.

Eric
Raj Puri
Ranch Hand

Joined: Apr 24, 2003
Posts: 189
Seems setTimeout meerly sets the timeout does not really detect inactivity?I tried this one and redirects after certain time whether I am active or not.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
What I said is you would have to build a funciton that determines if the user performs any actions on the window. It would be rather complicated and I am too busy to do it.

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I did a good search...I have no tested or tried this:

http://www.tek-tips.com/faqs.cfm?fid=2700

Eric
 
Consider Paul's rocket mass heater.
 
subject: Close or redirect after inactivity