[PHP-DOC] Bug #14571 Updated: setcookie behavoir changed in 4.1 from previous versions From: sander <email protected>
Date: 12/18/01

ID: 14571
Updated by: sander
Reported By: smclean <email protected>
Old Status: Open
Status: Bogus
Bug Type: Documentation problem
Operating System: Linux
PHP Version: 4.1.0
New Comment:

This hasn't changed. setcookie('name','') doesn't remove the cookie, and it never did. To remove a cookie, use setcookie with a expire-date in the past, i.e. setcookie('name','', time()-10000).

Previous Comments:
------------------------------------------------------------------------

[2001-12-17 21:36:35] smclean <email protected>

The behavoir of the setcookie function changed in 4.1.0 even though no such change was documented in the changelog. This had the effect of disabling an application of mine until I figured out what happened.

In PHP <4.1.0, the code:

 setcookie("cookiename","");

would delete the cookie 'cookiename'.

In PHP 4.1.0, this function created a cookie with a null value named cookiename.

I know this is a rather silly change, and you wouldn't expect someone to ever specify a blank value in the second argument, but it did cause a short downtime in our website software.

I posted this on the setcookie() manual page but it was rejected on grounds that it was more of a bug report than anything, so I thought I'd post it here.

Thanks

Sean

------------------------------------------------------------------------

Edit this bug report at http://bugs.php.net/?id=14571&edit=1