php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34431 setcookie() and header() only set the last cookie sent.
Submitted: 2005-09-08 18:04 UTC Modified: 2005-09-08 23:23 UTC
From: brian at risible dot org Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.0.5 OS: FreeBSD 5.4
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: brian at risible dot org
New email:
PHP Version: OS:

 

 [2005-09-08 18:04 UTC] brian at risible dot org
Description:
------------
Using the latest FreeBSD ports of Apache2 (2.0.53) and PHP (5.0.5), the exact same bug as described in bug #16626 appears, where only the last cookie sent will be set.

Reproduce code:
---------------
<?php
header("Set-Cookie: cookieone=a");
header("Set-Cookie: cookietwo=b");
header("Set-Cookie: cookiethree=c");
?>


Expected result:
----------------
Server: Apache/2.0.53 (FreeBSD) PHP/5.0.5
X-Powered-By: PHP/5.0.5
Set-Cookie: cookiethree=c
Content-Length: 4
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html

200 OK

Actual result:
--------------
Server: Apache/2.0.53 (FreeBSD) PHP/5.0.5
X-Powered-By: PHP/5.0.5
Set-Cookie: cookieone=a
Set-Cookie: cookietwo=b
Set-Cookie: cookiethree=c
Content-Length: 4
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html

200 OK

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-08 18:08 UTC] brian at risible dot org
Sorry.  I got the expected & actual fields the wrong way round.
 [2005-09-08 23:23 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Manual explictly says that if you want header() to send multiple copies of the same header you need to set to the 2nd parameter of the function to FALSE.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 05:01:31 2024 UTC