How would I create a script that automatically logs users out if they are inactive for lets say 5 minutes? Not quite sure how to accomplish this task on my own, need help!
inactive users
Started by
derek.sullivan
, May 13 2011 09:03 PM
5 replies to this topic
#1
Posted 13 May 2011 - 09:03 PM
#2
Posted 14 May 2011 - 09:00 AM
And if the user before 5 minutes becomes active again, it will refresh the timeout?
#3
Posted 14 May 2011 - 06:35 PM
any tutorial suggestions that you could link me to? I have no clue how to program in JS.
#4
Posted 14 May 2011 - 09:42 PM
any tutorial suggestions that you could link me to? I have no clue how to program in JS.
An Ajax call to a PHP script that would check the session information and return a boolean if they should be kept logged in or not. Let the PHP script do all the work, the JS just queries the PHP script and redirects if necessary.
#5
Posted 15 May 2011 - 12:34 PM
The other issue you have to be concerned about is if they leave your site before the 5 minutes is up. Do you want to still log them out? If so, you will need to record their "last active" time in the database and check that every time your script runs. If you forcefully boot them from your site after 5 minutes of inactivity, then you can use the JS method.
#6
Posted 15 May 2011 - 08:51 PM
RC, the answer to your question is yes. so I will see what I can do with the suggestions that you two gave me
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users