Bug #61037 [Opn->Nab]: Cookie Name Changing
Edit report at https://bugs.php.net/bug.php?id=61037&edit=1
ID: 61037
Updated by: laruence@php.net
Reported by: anoop_alex at yahoo dot com
Summary: Cookie Name Changing
-Status: Open
+Status: Not a bug
Type: Bug
Package: Apache related
Operating System: Windows 7 Prof
PHP Version: 5.3SVN-2012-02-10 (SVN)
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Dots and spaces in variable names are converted to underscores. For example <input
name="a.b" /> becomes $_REQUEST["a_b"].
http://php.net/manual/en/language.variables.external.php
Previous Comments:
------------------------------------------------------------------------
[2012-02-10 06:50:35] anoop_alex at yahoo dot com
Description:
------------
My application supports user IDs with underscore or dot between alphanumeric string. The users
preferences are stored in cookies. The cookie key is prefixed with the user id. It is observed that
the dots in the userIDs are getting converted to underscores in the setCookie method. The same
replacement doesn't appear to happen during retrieve and hence the application fails to detect
the preferences.
Sample Script:
<?php
setcookie("test.cookie.error","something");
print_r($_COOKIE);
?>
Output
Array ( [test_cookie_error] => something )
Test script:
---------------
<?php
setcookie("test.cookie.error","something");
print_r($_COOKIE);
?>
Expected result:
----------------
Array ( [test.cookie.error] => something )
Actual result:
--------------
Array ( [test_cookie_error] => something )
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61037&edit=1
Thread (2 messages)