#27267 [Opn->Bgs]: can't set cookies with points (.) and spaces ( )
| From: | sniper@php.net | Date: | Mon, 16 Feb 2004 04:18:41 +0000 |
| Subject: | #27267 [Opn->Bgs]: can't set cookies with points (.) and spaces ( ) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-54976@lists.php.net to get a copy of this message | ||
ID: 27267
Updated by: sniper@php.net
Reported By: silkensedai at online dot fr
-Status: Open
+Status: Bogus
Bug Type: HTTP related
Operating System: Linux Mandrake 9.2 + cooker
PHP Version: 4.3.4
New Comment:
Cookie names adhere to same rules as PHP variable names. Neither can
contain spaces or periods.
Previous Comments:
------------------------------------------------------------------------
[2004-02-15 20:11:09] silkensedai at online dot fr
Description:
------------
When we set a cookie with the function setcookie() and when the cookie
name have spaces " " or points ".", these characters are replaced by
underscures '_'.
I think that can be fix by urlencodind points (%2E) and spaces (%20).
Reproduce code:
---------------
<?php
setcookie('cookie_name.with spaces', 'value', time()+10000);
?>
<pre><?php print_r($_COOKIE); ?></pre>
<a href='#'>Reload</a>
Expected result:
----------------
===========
First time:
===========
Array
(
)
Reload
============
Second time:
============
Array
(
[cookie_name.with spaces] => value
)
Reload
Actual result:
--------------
===========
First time:
===========
Array
(
)
Reload
============
Second time:
============
Array
(
[cookie_name_with_spaces] => value
)
Reload
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27267&edit=1