|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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-2023 The PHP Group
All rights reserved.
Last updated: Tue Oct 03 12:01:26 2023 UTC