Page 1 of 1
automatic log out
Posted: Wed Mar 05, 2008 1:30 pm
by staar2
I got login and i would like to make it log out when some time expires. I got idea to make session var and hold the time when it were set with expire time. Then make check if the time is over and take back to login page.
$_SESSION['time'] = time() + time_expires;
What solution would you use ?
Re: automatic log out
Posted: Wed Mar 05, 2008 1:33 pm
by Sekka
Sessions automatically expire after a certain amount of time, so that should log the user out for you.
Re: automatic log out
Posted: Wed Mar 05, 2008 1:41 pm
by staar2
hm that's true when you have access to php ini file. But most server has the session lifetime set to 0

Re: automatic log out
Posted: Wed Mar 05, 2008 1:53 pm
by Sekka
They have the session cookie lifetime set to 0, not the session itself. It's usually about 20-30 minutes dependent on the server.