|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44804 setrawcookie('test', '') sets value as "deleted" instead of empty
Submitted: 2008-04-23 01:19 UTC Modified: 2008-04-28 23:30 UTC
Avg. Score:4.0 ± 0.8
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:3 (50.0%)
From: oliver at netconcepts dot com Assigned:
Status: Wont fix Package: HTTP related
PHP Version: 5.2CVS,5.3CVS (2008-04-24) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
42 - 10 = ?
Subscribe to this entry?

 [2008-04-23 01:19 UTC] oliver at netconcepts dot com
the setrawcookie function doesn't set an empty value but sets the value 'deleted' instead.

An empty value is perfectly fine in a cookie, there is no need to modify that value in any way.

This bug is the same for PHP 4.3.1, and it was never solved?

Reproduce code:
setrawcookie('testcookie', '');

Expected result:
(Firefox Live HTTP Headers output)

Set-Cookie: testcookie=

Actual result:
(Firefox Live HTTP Headers output)

Set-Cookie: testcookie=deleted


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-28 23:19 UTC]
A fix would be a massive BC break since many applications rely on "" 
value resulting in cookie deletion.
 [2008-04-28 23:30 UTC] oliver at netconcepts dot com
setting a cookie value to 'deleted' has nothing to do with a deleted cookie. Thats just a string, not an action or whatever.

I cannot imagine any application that relies on 'deleted' cookies showing up with a value of 'deleted' instead of '' (empty string).

A fix should at least go into the next major version.

Additionally the documentation needs an update.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 11:01:30 2024 UTC