Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- SESSION timeout using time()
March 12, 2005, 3:08 am
rate this thread
I don't have access to the php.ini on my hosting provider's shared server
and don't want to rely on cookies, so I'm wondering if this a reliable way
to timeout a session:
if (credentials are valid)
$_SESSION['timeout'] = time();
redirect to url
if ($_SESSION['timeout'] > (time() - 300))
echo "You are logged in."
echo "Your session has timed out."
Seems to work - but I'm new to php... am I'm missing something?
Thanks in advance.
Re: SESSION timeout using time()
*** deko escribió/wrote (Fri, 11 Mar 2005 21:08:41 GMT):
It seems correct. Since you are always using the same clock (the server
one) there should be no problem.
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox