Re: Cookie Expire Time - Client or Server?
| From: | Martin | Date: | Thu, 14 Sep 2000 07:42:22 +0000 |
| Subject: | Re: Cookie Expire Time - Client or Server? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16730@lists.php.net to get a copy of this message | ||
Hi Brandon,
I think it's a problem that the cookie is set in server-time while the
browser delets it in browser-time. I would do the following: Make a
small file (aor store it in a database) when the cookie was set on the
server. If 5 min have expired, then delete the cookie from a script.
Regards
Martin
Brandon Bell wrote:
>
> When setting the expire time of a cookie in PHP like:
> setcookie ("TestCookie", $value, time()+300); /* expire in 5 minutes */
> the time is obviously relative to the current time on the server.
>
> If the client's clock isn't in sync with the server, isn't there a
> problem as to when this cookie will actually expire?
>
> What I want is for the cookie to expire after 5 minutes from the time it
> was set, but if the client's clock has a different time than the
> server's my guess is that the cookie will expire either faster or slower
> than the 5 minutes that I want.
>
> Can someone confirm my suspicions here. If I'm correct, does anyone
> have a workaround?
>
> Thanks!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net