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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sat Dec 21 17:01:58 2024 UTC