|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-18 05:32 UTC] betz@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 14:00:01 2025 UTC |
In the current version of the PHP html documentation, under the function "setcookie(...)" it states: If only the name argument is present, the cookie by that name will be deleted from the remote client. This is only partially true, as the other arguments to the function must be called exactly as they were upon creation of the cookie. At least this is true for Mozilla 1.1 (verified with the cookie manager), and your documentation seems to indicate the same, when it states under "Common Pitfalls": Cookies must be deleted with the same parameters as they were set with. Making this point clear from the beginning would save confusion for developers. This is also a problem since sites that mirror the documentation (at least zend.org) don't always include the "Common Pitfalls" section. Consider replacing: If only the name argument is present, the cookie by that name will be deleted from the remote client. With: If the value argument is an empty string (""), and all other arguments match a previous call to setcookie, then the cookie with the specified name will be deleted from the remote browser. Also, a sample of doing this would be nice: If in login.php you have: <? setcookie("UID","SOMEVALUE","/subdir","myhost.com",TRUE); ?> You should have in logout.php: <? setcookie("UID","","/subdir","myhost.com",TRUE); ?> Thanks for your attention, Todd Willey