#34431 [Opn->Bgs]: setcookie() and header() only set the last cookie sent.

From: Date: Thu, 08 Sep 2005 21:23:59 +0000
Subject: #34431 [Opn->Bgs]: setcookie() and header() only set the last cookie sent.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84761@lists.php.net to get a copy of this message
ID: 34431 Updated by: iliaa@php.net Reported By: brian at risible dot org -Status: Open +Status: Bogus Bug Type: Apache2 related Operating System: FreeBSD 5.4 PHP Version: 5.0.5 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2005-09-08 18:08:46] brian at risible dot org Sorry. I got the expected & actual fields the wrong way round. ------------------------------------------------------------------------ [2005-09-08 18:04:38] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34431&edit=1

« previous php.bugs (#84761) next »