Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    349
    Thanks
    2
    Thanked 0 Times in 0 Posts

    15 minute inactivity, redirects. How to capture ANY action on page?

    Hello,

    what would be the code to have a "timer" on a page for 15 minutes. If the user clicks something, does anything - the timer resets.. otherwise, if they are in ative for 15 minutes, the page redirects.

    how?

  • #2
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Using setTimeout(); may work.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    349
    Thanks
    2
    Thanked 0 Times in 0 Posts
    well, that would be "how to start the timer".. but the thing is, if they press a button or interact with the page at all, it resets.

    I can't just setTimeOut because the user can be on a page for a hour if they want, its just that if they are there for 15 minutes without doing anything - no clicks, no nothing.. THEN we redirect.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,173
    Thanks
    203
    Thanked 2,549 Times in 2,527 Posts
    Quote Originally Posted by BrightNail View Post
    well, that would be "how to start the timer".. but the thing is, if they press a button or interact with the page at all, it resets.

    I can't just setTimeOut because the user can be on a page for a hour if they want, its just that if they are there for 15 minutes without doing anything - no clicks, no nothing.. THEN we redirect.
    I thought that was what you wanted.

    Use setTimeout() - reset the timer onkeyup, onmousemove
    but
    Note: Each time a user moves the mouse one pixel, a mousemove event occurs. It takes system resources to process all mousemove events.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •