note 17528 added to function.setcookie

From: Date: Wed, 12 Dec 2001 22:34:48 +0000
Subject: note 17528 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-22562@lists.php.net to get a copy of this message
The behavoir of setcookie changed between php 4.0 and php 4.1, though no documentation that comes with 4.1 reflects this change. Previously, with < 4.1, if you ran 'setcookie("cookiename","")' it would delete the cookie named cookiename exactly as if you ran 'setcookie("cookiename")'. With 4.1, when you run 'setcookie("cookiename","")', a cookie named cookiename with a null value is set. Paradoxically, if you run 'setcookie("cookiename","","","/","domain.com")' the cookie matching the path and domain arguments is deleted. Annoying incosistency, I wonder why they changed it. I wish they would have documented this in the changelog, as it ended up breaking our login system for 30 minutes or so while I debugged. -- http://www.php.net/manual/en/function.setcookie.php http://master.php.net/manage/user-notes.php?action=edit+17528 http://master.php.net/manage/user-notes.php?action=delete+17528 http://master.php.net/manage/user-notes.php?action=reject+17528

« previous php.notes (#22562) next »