#22642 [Fbk->Csd]: After saving a session var in a var, nulling the session var clears the 2nd var
| From: | dave at orangechicken dot com | Date: | Wed, 12 Mar 2003 09:27:08 +0000 |
| Subject: | #22642 [Fbk->Csd]: After saving a session var in a var, nulling the session var clears the 2nd var | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-35424@lists.php.net to get a copy of this message | ||
ID: 22642
User updated by: dave at orangechicken dot com
Reported By: dave at orangechicken dot com
-Status: Feedback
+Status: Closed
Bug Type: Session related
Operating System: Linux / Apache 1.3.27
PHP Version: 4.3.1
New Comment:
I'm uber-tarded. I found the solution an hour later or so (and it's the
same one suggested above). I used an .htaccess file to turn
register_globals off. I had been working in my dev environment so long
(with register_globals off in php.ini) that I didn't even think about
that when I moved to the live environment (which defaults to on).
My bad. Case closed.
Previous Comments:
------------------------------------------------------------------------
[2003-03-11 21:07:22] sniper@php.net
Please provide a short but complete example script.
And is register_globals=off ?
And what about session.bug_compat_42 and session.bug_compat_warn?
Put 'error_reporting(E_ALL);' as first line in your script,
you propably get some errors..
------------------------------------------------------------------------
[2003-03-11 15:54:35] dave at orangechicken dot com
OK, the summary was too short to concisely enter what I mean. Here's
the real version:
After assigning a stored $_SESSION var to another variable, assigning
null to the $_SESSION var clears the other variable too.
This worked before 4.3.1 (possibly occurred in 4.3.0 - we skipped from
4.2.7 to 4.3.1).
Here's a snippet where the problem occurs. $_SESSION[ 'login_redirect'
] contains the value 'checkout.php'.
================================
$redirect = $_SESSION[ 'login_redirect' ];
echo $redirect; // outputs checkout.php
$_SESSION[ 'login_redirect' ] = null;
echo $redirect; // outputs <nothing>
================================
Here's the configure string
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml'
'--enable-bcmath' '--enable-calendar' '--with-curl'
'--enable-ftp'
'--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
'--with-xpm-dir=/usr/X11R6' '--with-imap' '--with-imap-ssl'
'--with-kerberos' '--with-mcrypt' '--enable-magic-quotes'
'--with-mysql' '--with-pear' '--enable-xslt'
'--with-xslt-sablot'
'--enable-sockets' '--enable-track-vars' '--with-ttf'
'--with-freetype-dir=/usr' '--enable-gd-native-ttf'
'--enable-versioning' '--with-zlib'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22642&edit=1