|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-03-31 07:20 UTC] jani@php.net
[2009-03-31 08:10 UTC] whistl0r+phpbug at googlemail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 19:00:01 2025 UTC |
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.