RE: SETCOOKIE

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

 



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.

And while it might mostly kinda sorta usually work, that's not really
super reliable.

Using 0 for the time, however, is HTTP Spec for "session cookie" which
means the cookie will disappear when the browser is quit.

Note that stupidity on the part of MS engineers makes the "path"
parameter required when you include the "time" parameter.

I.e., the cookie spec was implemented not as:
setcookie(var, value, [time], [path], ...)

but was instead implemented as:
setcookie(var, value, [time, path], ...)

The inclusing of "time" requires the inclusion of "path"

The path of "/" should work the same as the intended default behaviour.

-- 
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