Answer the question
In order to leave comments, you need to log in
How to log out a user who is not active for a certain amount of time?
Interested in the implementation of the following: It is necessary to delete the session where the administrator was not active within, say, 10 minutes after the last activity. Something like this: Logged in -> wandered through the admin panel-> no action for 10 minutes -> activity -> throws it on the authorization page and asks to enter the password again.
Answer the question
In order to leave comments, you need to log in
Setting the cookie and session lifetime should solve the problem in most cases.
if ($_SESSION['last_activity']-date()>=600) {header("Location: /logon/");exit;}
else $_SESSION['last_activity']=date();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question