#30221 [Opn->Csd]: Cookies & booleans

From: Date: Sun, 26 Sep 2004 02:24:58 +0000
Subject: #30221 [Opn->Csd]: Cookies & booleans
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969364279@lists.php.net to get a copy of this message
ID: 30221 Updated by: aidan@php.net Reported By: wescotte at earthlink dot net -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Win XP PHP Version: 5.0.1 New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. FALSE is the same as '', which is the method described for unsetting a cookie. I've added a note to explain this better. Previous Comments: ------------------------------------------------------------------------ [2004-09-24 17:40:49] wescotte at earthlink dot net Description: ------------ I was attempting to set a cookie using a boolean. TRUE works correctly as 1 but setting it FALSE would not save a cookie at all. Reproduce code: --------------- setcookie("name",FALSE,time()+60*60); if you print_r($_COOKIE); it won't display name as being in the $_COOKIE array but if you setcookie("name",TRUE,time()+60*60); it lists name == 1 in $_COOKIE Expected result: ---------------- If it's a by design issue it might be a good idea to include this in the docs stating not to use booleans with cookies. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30221&edit=1

« previous php.doc (#969364279) next »