|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18073 SetCookie generates error-message with empty string as parameter #3
Submitted: 2002-06-30 15:01 UTC Modified: 2002-06-30 15:10 UTC
From: matslin at orakel dot ntnu dot no Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.2.1 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: matslin at orakel dot ntnu dot no
New email:
PHP Version: OS:


 [2002-06-30 15:01 UTC] matslin at orakel dot ntnu dot 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:

  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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-30 15:10 UTC]
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.

"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."
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 17:01:31 2024 UTC