Bug #79478 [NEW]: PHP parses cookies invalid cookies (RFC6265)

From: Date: Wed, 15 Apr 2020 11:50:31 +0000
Subject: Bug #79478 [NEW]: PHP parses cookies invalid cookies (RFC6265)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226586@lists.php.net to get a copy of this message
From: marius dot grigaitis dot ext at home24 dot de Operating system: MacOS PHP version: 7.4.4 Package: HTTP related Bug Type: Bug Bug description:PHP parses cookies invalid cookies (RFC6265) 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 bug report at https://bugs.php.net/bug.php?id=79478&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79478&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79478&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79478&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79478&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79478&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79478&r=support Expected behavior: https://bugs.php.net/fix.php?id=79478&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79478&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79478&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79478&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79478&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79478&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79478&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79478&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79478&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79478&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79478&r=mysqlcfg

« previous php.bugs (#226586) next »