Bug #79478 [Opn->Nab]: PHP parses cookies invalid cookies (RFC6265)

From: Date: Wed, 15 Apr 2020 12:02:19 +0000
Subject: Bug #79478 [Opn->Nab]: PHP parses cookies invalid cookies (RFC6265)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226587@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79478&edit=1 ID: 79478 Updated by: requinix@php.net Reported by: marius dot grigaitis dot ext at home24 dot de Summary: PHP parses cookies invalid cookies (RFC6265) -Status: Open +Status: Not a bug Type: Bug Package: HTTP related Operating System: MacOS PHP Version: 7.4.4 Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2020-04-15 11:50:31] marius dot grigaitis dot ext at home24 dot de Description: ------------ RFC6265 states that key=value pairs of cookies inside Cookie header are separated by "; " (semicolon space) https://tools.ietf.org/html/rfc6265#section-5.4 However, PHP accepts cookies separated by only semicolon This leads to to a situation where multiple application (written in different languages) see different cookies in the same request Test script: --------------- test.php: <?php var_dump($_COOKIE); ------ $ php -S 127.0.0.1:8080 test.php $ curl -H "Cookie: foo=bar;;bar=baz" http://127.0.0.1:8080/test.php Expected result: ---------------- array(1) { ["foo"]=> string(3) "bar" } Actual result: -------------- array(2) { ["foo"]=> string(3) "bar" ["bar"]=> string(3) "baz" } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=79478&edit=1

« previous php.bugs (#226587) next »