Bug #73344 [Asn->Nab]: header() removes previously defined headers when replace flag is false

From: Date: Wed, 19 Oct 2016 05:27:21 +0000
Subject: Bug #73344 [Asn->Nab]: header() removes previously defined headers when replace flag is false
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204909@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73344&edit=1 ID: 73344 Updated by: yohgaki@php.net Reported by: yohgaki@php.net Summary: header() removes previously defined headers when replace flag is false -Status: Assigned +Status: Not a bug Type: Bug Package: Unknown/Other Function Operating System: Irrelevant PHP Version: Irrelevant Assigned To: yohgaki Block user comment: N Private report: N New Comment: There was bug in script. Remove flag works fine. I should have removed needless sprintf(). Previous Comments: ------------------------------------------------------------------------ [2016-10-19 04:58:51] yohgaki@php.net Description: ------------ header() removes previously defined headers when replace flag is false. Test script: --------------- <?php ob_start(); ini_set('session.use_cookies', 1); ini_set('session.save_handler', 'files'); session_name('BUG'); session_start(); // Bug0 session_regenerate_id(true); // Bug2 header(sprintf('Set-Cookie: BUG=BUG2; expires=Sat, 03-Sep-2020 05:38:43 GMT; path=/;', false)); Expected result: ---------------- $ ./sapi/cgi/php-cgi s.php X-Powered-By: PHP/5.6.28-dev Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: BUG=45df8aabbae8b88139fefdc46c2de696; path=/ Set-Cookie: BUG=BUG2; expires=Sat, 03-Sep-2020 05:38:43 GMT; path=/; Content-type: text/html; charset=UTF-8 Actual result: -------------- $ ./sapi/cgi/php-cgi s.php X-Powered-By: PHP/5.6.28-dev Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: BUG=BUG2; expires=Sat, 03-Sep-2020 05:38:43 GMT; path=/; Content-type: text/html; charset=UTF-8 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73344&edit=1

« previous php.bugs (#204909) next »