Hey,

There's a very interesting user contributed note for the setcookie() function (Follows in the end).
I think it makes sense to support Max-Age because it fixes clock skew problems between the client and server.
Not sure if an how this could be added to setcookie() because of the already rich amount of parameters it accepts. Would it make sense to have something like setcookie_max_age() or something similar?


Andi


add a note User Contributed Notes setcookie mr-yellow at mr-yellow dot com 15-Aug-2004 10:14 Sorry Secure not Secure=1....

Instead of setcookie it would be much safer to use the new
better specs and send the following.

A 1 hour cookie is as follows:

header('Set-Cookie: TestCookie=something+from+somewhere; Max-Age=3600; Domain=.www.domain.com; Path=/; secure;');

To Delete a cookie set -1:

header('Set-Cookie: TestCookie=something+from+somewhere; Max-Age=-1; Domain=.www.domain.com; Path=/; secure;');

-Ben

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to