From: sailormax at inbox dot lv
Operating system: any
PHP version: 5.2.12
PHP Bug Type: Feature/Change Request
Bug description: header replace Set-Cookie as similar header
Description:
------------
function header() has second parameter = replace;
it turned on by default;
in result it replace all previous "Set-cookie:", including Set-cookie of
session. Why it do not look at cookie name and domain? By standard header
can contain several Set-cookie...
Yes, I can turn off replace, but for what this parameter in result? I
think for remove duplicates in header. For remove duplicates like few
"Content-type:", "Date:", "Expires:",... and for remove duplicates in few
similar by _name, domain and path_ "Set-cookie:".
Reproduce code:
---------------
session_start();
header("Set-cookie: lang.name=en;expires=Wed, 01 Jan 2020 16:59:02
GMT;path=/;");
Expected result:
----------------
in header:
~~~~~~~~~~~~~
Set-Cookie: sessid=efd66810c22e02211ad598d93aff7d211e7b17b7; expires=Thu,
25 Feb 2010 16:59:02 GMT; path=/
Set-cookie: lang.name=en;expires=Wed, 01 Jan 2020 16:59:02 GMT;path=/;
~~~~~~~~~~~~~
all not duplicated cookies
Actual result:
--------------
in header:
~~~~~~~~~~~~~
Set-cookie: lang.name=en;expires=Wed, 01 Jan 2020 16:59:02 GMT;path=/;
~~~~~~~~~~~~~
only last cookie...
--
Edit bug report at http://bugs.php.net/?id=51116&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51116&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51116&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51116&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51116&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51116&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51116&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51116&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51116&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51116&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51116&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51116&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51116&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51116&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51116&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51116&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51116&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51116&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51116&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51116&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51116&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51116&r=mysqlcfg