|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #68390 setcookie to override same name cookies
Submitted: 2014-11-10 10:45 UTC Modified: 2014-11-10 10:52 UTC
From: coladict at gmail dot com Assigned:
Status: Duplicate Package: *General Issues
PHP Version: Irrelevant OS:
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: coladict at gmail dot com
New email:
PHP Version: OS:


 [2014-11-10 10:45 UTC] coladict at gmail dot com
The last Set-Cookie header, setting a cookie by the same name, always overrides the data in the browser, but multiple set-cookie headers are send for the same name. This initially caused our proxy server to reject the response, because the header size exceeded the default limit.

setcookie() should override previous calls to the same cookie name. It should also issue an E_NOTICE message when overriding a previously called cookie, for easier tracing of problems where a cookie might wrongly be overridden.

Test script:

Expected result:
In the response headers as suggested:


Actual result:
In the response headers as it is now:



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-10 10:52 UTC]
-Status: Open +Status: Duplicate
 [2014-11-10 10:52 UTC]
Duplicate of bug #67736 (which links to, where a lively discussion is taking place on whether this should be changed or not, and if so, how).
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Oct 17 09:03:34 2021 UTC