#48223 [Opn->Bgs]: Override $_COOKIE forces new session ID
| From: | johannes@php.net | Date: | Sun, 10 May 2009 15:47:58 +0000 |
| Subject: | #48223 [Opn->Bgs]: Override $_COOKIE forces new session ID | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137110@lists.php.net to get a copy of this message | ||
ID: 48223
Updated by: johannes@php.net
Reported By: martijn at site-to-make dot nl
-Status: Open
+Status: Bogus
Bug Type: Session related
Operating System: Debian 5
PHP Version: 5.2.9
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
1) you should not manipulate super globals but only it's elements
2) sessions relying n $_COOKIE is the expected behavior
Previous Comments:
------------------------------------------------------------------------
[2009-05-10 14:53:01] martijn at site-to-make dot nl
Description:
------------
If $_COOKIE is overriden in a script, every request a new session id is
generated. The old session data will not be loaded again.
Reproduce code:
---------------
<?php
$_COOKIE = null;
session_start();
if (!isset($_SESSION['views']))
$_SESSION['views'] = 1;
else
$_SESSION['views']++;
echo $_SESSION['views'];
Expected result:
----------------
Incrementing value and session should use the internal cookie values
Actual result:
--------------
1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48223&edit=1