wood burning stoves*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Close or redirect after inactivity
 
Similar Threads
on button click value is not getting
How harricanes are named?
onsite salary
What comes
How to pass the values when we click on button in jsf