ID:               47800
 Updated by:       j...@php.net
 Reported By:      whistl0r+phpbug at googlemail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Session related
 Operating System: Windows
 PHP Version:      5.3.0RC1
 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




Previous Comments:
------------------------------------------------------------------------

[2009-03-27 02:36:36] whistl0r+phpbug at googlemail dot com

Description:
------------
When forcing PHP to not use cookies for sessions, PHP isn't able to
load an existing session. Instead it will create a new one.

Tested with the default php.ini (php.ini-production) coming with the
php-5.3.0RC1-nts-Win32-VC6-x86.zip package.

I just fixed line 428 and set the session.save_path value.

Session files will be created as expected.

With PHP <5.3, the script is working as expected.

I can confirm, that this problem is still present in the latest
snapshot (VC6 x86 Thread Safe (2009-Mar-26 19:00:00)).

Reproduce code:
---------------
<?php
// Disable Cookie-Usage
ini_set('session.use_cookies', 0);

// Start the session
session_start();

if (!isset($_SESSION['counter']))
{
        // Initialize SESSION
        $_SESSION['counter'] = 1;
}
else
{
        // Existing SESSION - Update value
        $_SESSION['counter'] = $_SESSION['counter'] + 1;
}

// Print SESSION value
printf('Counter value #%u<br />' . PHP_EOL, $_SESSION['counter']);

// Print Next link
printf('<a href="%s?%s">Next</a>',
        $_SERVER['PHP_SELF'],
        SID
);


Expected result:
----------------
When you first run this code, a session with a variable "counter" with
the value "1" (int) should be created and a link pointing to the same
script with this SESSION-ID should be displayed.

When you click this link, you run this code again and the previous
created session should be loaded and the "counter" variable should be
incremented by 1.

Actual result:
--------------
On every run, PHP creates a new session.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47800&edit=1

Reply via email to