|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-03-25 19:53 UTC] anarres at gmx dot net
Two days ago I installed PHP Version 4.1.2 as CGI on a Win98SE platform with Apache 1.3.20 running as server. I used the php.ini-recommended with register_globals turned OFF and made only minor changes concerning directories and error-display. Migrating my old scripts to the new settings I found that the session management with the superglobal $_SESSION would not work: the session file was created in my session directory (session.save_path=c:\tmp) BUT no session variables were stored in it.
Here's a pair of scripts to illustrate:
session_1.php:
<?php
session_start();
$_SESSION['text']="Hallo!";
echo '<a href="session_2.php">session_2.php</a>';
?>
session_2.php:
<?php
session_start();
echo $_SESSION['text'];
?>
On activating the link to session_2.php, the following errormessage is displayed:
Warning: Undefined index: text in session_2.php on line 3
(Using $HTTP_SESSION_VARS['text'] instead of $_SESSION['text'] leads to the same result.)
However, turning register_globals ON and using global variables with session_register(), session_unregister() and session_is_registered() works fine. But that's not really the point of php.ini-recommended, is it? ;-)-:
After spending many hours checking my setup, reading the manual and several faqs and finally receiving feedback from other users who have the same problem on the german PHP-mailinglist php@phpcenter.de and not finding it this bug in your list of reported bugs, I decided to report it. I also thought that this is a rather major problem, since register_globals is to be turned off by default in upcoming versions. Please contact me if you need any additional information - this is the first time I am reporting a bug.
Thanx 4 your great work,
Robert
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
Two days ago I installed PHP Version 4.1.2 as CGI on a Win98SE platform with Apache 1.3.20 running as server. I used the php.ini-recommended with register_globals turned OFF and made only minor changes concerning directories and error-display. Migrating my old scripts to the new settings I found that the session management with the superglobal $_SESSION would not work: the session file was created in my session directory (session.save_path=c:\tmp) BUT no session variables were stored in it. Here's a pair of scripts to illustrate: session_1.php: <?php session_start(); $_SESSION['text']="Hallo!"; echo '<a href="session_2.php">session_2.php</a>'; ?> session_2.php: <?php session_start(); echo $_SESSION['text']; ?> On activating the link to session_2.php, the following errormessage is displayed: Warning: Undefined index: text in session_2.php on line 3 (Using $HTTP_SESSION_VARS['text'] instead of $_SESSION['text'] leads to the same result.) However, turning register_globals ON and using global variables with session_register(), session_unregister() and session_is_registered() works fine. But that's not really the point of php.ini-recommended, is it? ;-)-: After spending many hours checking my setup, reading the manual and several faqs and finally receiving feedback from other users who have the same problem on the german PHP-mailinglist php@phpcenter.de and not finding it this bug in your list of reported bugs, I decided to report it. I also thought that this is a rather major problem, since register_globals is to be turned off by default in upcoming versions. Please contact me if you need any additional information - this is the first time I am reporting a bug. Thanx 4 your great work, Robert