#44050 [Opn]: Multiple 'Cookie: ' headers incorrectly parsed
| From: | msaraujo@php.net | Date: | Tue, 05 Feb 2008 20:31:59 +0000 |
| Subject: | #44050 [Opn]: Multiple 'Cookie: ' headers incorrectly parsed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-122013@lists.php.net to get a copy of this message | ||
ID: 44050
Updated by: msaraujo@php.net
Reported By: a dot candle at gmail dot com
Status: Open
Bug Type: Unknown/Other Function
Operating System: slackware/debian
PHP Version: 5.2.5
New Comment:
Hello,
I have not been able to reproduce your issue. Can you please give us
more feedback about that?
Previous Comments:
------------------------------------------------------------------------
[2008-02-05 17:37:48] a dot candle at gmail dot com
Description:
------------
When a client sends multiple 'Cookie' headers they appear to be parsed
incorrectly.
What I believe is happening is that the value part of the cookie
headers (after the ': ') are being concaternated with a comma rather
then a semicolon. Then (as per the cookie spec:
http://wp.netscape.com/newsref/std/cookie_spec.html)
the resulting
string is being split on semicolon, resulting in the broken cookie
values.
Reproduce code:
---------------
php code:
<?php
setcookie("a", "aaaa");
setcookie("b", "bbbb");
setcookie("c", "cccc");
var_dump($_COOKIE);
?>
headers sent by client: (on the second request)
"Cookie: $Version=0; a=aaaa\r\n"
"Cookie: $Version=0; b=bbbb\r\n"
"Cookie: $Version=0; c=bbbb\r\n"
Expected result:
----------------
array(4) {
["$Version"]=>
string(1) "0"
["a"]=>
string(4) "aaaa"
["b"]=>
string(4) "bbbb"
["c"]=>
string(4) "cccc"
}
Actual result:
--------------
resulting output:
array(4) {
["$Version"]=>
string(1) "0"
["a"]=>
string(16) "aaaa, $Version=0"
["b"]=>
string(16) "bbbb, $Version=0"
["c"]=>
string(4) "cccc"
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44050&edit=1