Bug->Req #77407 [Opn->Sus]: Cookie name not parsed correctly

From: Date: Fri, 04 Jan 2019 11:52:02 +0000
Subject: Bug->Req #77407 [Opn->Sus]: Cookie name not parsed correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218789@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77407&edit=1 ID: 77407 Updated by: cmb@php.net Reported by: devosc at gmail dot com Summary: Cookie name not parsed correctly -Status: Open +Status: Suspended -Type: Bug +Type: Feature/Change Request Package: *Programming Data Structures -PHP Version: 7.3.0 +PHP Version: next Block user comment: N Private report: N New Comment: This is intended and well documented[1] behavior, coming from the old times where request parameters (could) have been registered as PHP variables. Changing the behavior would now technically be possible, but due to the BC break, this needs discussion on internals@, and likely the RFC process[2]. Feel free to start it; for the time being I'm suspending this ticket. [1] <http://php.net/manual/en/language.variables.external.php#language.variables.external.dot-in-names> [2] <https://wiki.php.net/rfc/howto> Previous Comments: ------------------------------------------------------------------------ [2019-01-03 16:48:48] devosc at gmail dot com Description: ------------ "PHP will replace special characters in cookie names, which results in other cookies not being available due to overwriting. Thus, the server request should take the cookies from the request header instead." https://github.com/zendframework/zend-diactoros/blob/master/src/functions/parse_cookie_header.php It seems like this should be fixed in PHP itself, as this is the purpose of having the super global $_COOKIE. Test script: --------------- setcookie('foo.bar', 'foobar'); Expected result: ---------------- $_COOKIE = [ 'foo.bar' => 'foobar'] Actual result: -------------- $_COOKIE = [ 'foo_bar' => 'foobar'] ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77407&edit=1

« previous php.bugs (#218789) next »