Bug #18073 Updated: SetCookie generates error-message with empty string as parameter #3
| From: | sander@php.net | Date: | Sun, 30 Jun 2002 19:10:29 +0000 |
| Subject: | Bug #18073 Updated: SetCookie generates error-message with empty string as parameter #3 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-12594@lists.php.net to get a copy of this message | ||
ID: 18073
Updated by: sander@php.net
Reported By: matslin@orakel.ntnu.no
-Status: Open
+Status: Bogus
-Bug Type: Documentation problem
+Bug Type: HTTP related
Operating System: Linux
PHP Version: 4.2.1
New Comment:
No, the docs say you can skip any argument _except_ expire and secure
with an empty string, you should use 0 to skip expire and secure.
From http://www.php.net/manual/en/function.setcookie.php:
"You may also replace any argument with an empty string ("") in order
to skip that argument. The expire and secure arguments are integers and
cannot be skipped with an empty string. Use a zero (0) instead."
Previous Comments:
------------------------------------------------------------------------
[2002-06-30 15:01:00] matslin@orakel.ntnu.no
While the documentation says that the third parameter is optional and
can be given with a empty string, the following code does now generate
a warning:
<?php
setcookie('test', '', '');
?>
This changed somewhere between 4.1.2 and 4.2.1.
Since error-output before trying to set the cookie is somewhat
problematic (when not using output buffering) this also broke BC in a
minor way.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18073&edit=1