RE: SETCOOKIE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, August 13, 2006 2:20 am, Peter Lauri wrote:
> [snip]
>
> On Sat, August 12, 2006 8:00 am, Peter Lauri wrote:
>> When you just use time() you tell the cookie to just live until now,
>> so it
>> dies directly. You have to add some seconds to determine how long
>> the
>> cookie
>> will live.
>
> Unfortunately, no...
>
> The above solution relies on the USER computer clock being set
> correctly.
>
> [/snip]
>
> This is interesting. Because you set the time as the Server time, it
> will
> then just assume that the time is the same. However, is the system not
> that
> smart that it do translate the time when being sent (timestamp and
> expire
> time sent the same way, or just the number of seconds that the cookie
> will
> be alive from.
>
> If this is correct, what will happen if the server is in a different
> time
> zone?

The time is GMT, so if everybody's computer clock is set correctly,
and their BIOS setting for UTC versus GMT or whatever is correct, and
...

So, pretty much, it's not something you want to rely on for short time
periods...

Probably better to set a very long expiration (2 years is max
guaranteed to work by spec) and then manage all the expiration issues
on the server, using the server clock, which should be
self-consistent, if not correct.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux