#20709 [Com]: Session variable getting mysteriously set

From: Date: Tue, 21 Nov 2006 01:33:34 +0000
Subject: #20709 [Com]: Session variable getting mysteriously set
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-105229@lists.php.net to get a copy of this message
ID: 20709 Comment by: dpegasusm at gmail dot com Reported By: DChri36990 at aol dot com Status: No Feedback Bug Type: Class/Object related Operating System: Windows 2000 PHP Version: 4.2.3 New Comment: i had a similar problem occur in PHP 4.4.4 where i called a variable called $_SESSION['userID'] which had been previously set to the user's ID number. later on in the script i set $userID to a value and it would also set the session variable. strangely this mysterious resetting only happened for one particular instance of setting $userID to a new value. all other times it was reset it didn't affect the session variable. i tried moving the entire site onto a second server to see what happens and it worked fine there. both servers had the exact same configuration. and were running Linux with Apache 1.3.37. Previous Comments: ------------------------------------------------------------------------ [2002-12-08 10:19:35] sniper@php.net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2002-11-28 22:09:12] iliaa@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip This is something that I believe was fixed in 4.3.0, please try the RC2 and report if the problem persists. Also, is you register_globals on? ------------------------------------------------------------------------ [2002-11-28 20:50:29] DChri36990 at aol dot com When my code does the following in sequence: 1) $_SESSION['League'] = 1; /* or any other number */ 2) unset($_SESSION['League']); 3) $League = new AnyObject(...); The variable $_SESSION['League'] gets set to the contents of "AnyObject". This doesn't occur if the Session variable had never been set/unset, nor does it occur when the Session variable has an existing value in it when statement (3) occurs. Addtionally, this assignment doesn't occur immediately at the time that statement (3) is executed. It is somehow delayed until after the script completes. It's only when I go on to execute another script when I encounter the "mystery" assignment. I haven't tried this with names other than 'League', but common sense suggests this is likely a generic problem independant of the specific name I happened to use. FYI, I'm running Apache version 1.3, the latest stable release for Windows. My PHP configuration is generic, with the exception of including the module(s) required to do XML/XSLT transforms. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20709&edit=1

« previous php.bugs (#105229) next »