ID: 48191
Updated by: [email protected]
Reported By: jens at dutzi dot me
-Status: Open
+Status: Feedback
Bug Type: Session related
Operating System: Debian (lenny)
PHP Version: 5.3.0RC2
-Assigned To:
+Assigned To: fb-req-jani
New Comment:
You must also check the "session.use_only_cookies" directive and set
that also to 0 to be able to really use cookies.
Previous Comments:
------------------------------------------------------------------------
[2009-05-08 14:19:46] jens at dutzi dot me
Description:
------------
When forcing PHP to not use cookies for sessions, PHP doesn't recognize
the existing session. Instead it will create a new one. Session files
will be created as expected.
The Bug can be reproduced with:
1.) ini_set('session.use_cookies', 0); in the php-code
and
2.) session.use_cookies = 0; in php.ini
The following sample code is identical to
http://www.php.net/manual/en/session.idpassing.php
Reproduce code:
---------------
<?php
// Disable Cookie-Usage
ini_set('session.use_cookies', 0);
// Start the session
session_start();
if (empty($_SESSION['count'])) {
$_SESSION['count'] = 1;
} else {
$_SESSION['count']++;
}
?>
<p>Hello visitor, you have seen this page <?php echo
$_SESSION['count']; ?> times.</p>
<p>To continue, <a href="test.php?<?php echo htmlspecialchars(SID);
?>">click here</a>.</p>
Expected result:
----------------
On the first run, a new session should be created with
$_SESSION['count'] = 1. On everey reload $_SESSION['count'] should be
increased. (s.a. example #1 at
http://www.php.net/manual/en/session.idpassing.php)
Actual result:
--------------
On every run, PHP creates a new session with $_SESSION['count']=1.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48191&edit=1