RE: [PHP] Session Headaches

From: Date: Tue, 21 Aug 2001 23:39:06 +0000
Subject: RE: [PHP] Session Headaches
Groups: php.general 
Request: Send a blank email to php-general+get-63795@lists.php.net to get a copy of this message
> I am using php 4.0.6 and i would rather not use global variables. I hear ya. After playing around with this, your approach works if register_globals is set to off (I did this with an .htaccess file). I'm surprised by this. It appears that the global version of a variable still overwrites the HTTP_SESSION_VARS version when the script ends and the data is stored to the session file, in spite of the change in this area in 4.0.6. This is not the behavior I expected with this bug fix, but it appears to be the case. Since your code never sets the global version of $FailedLogins, nothing gets stored in the session. Unless I'm missing something, it looks like register_globals needs to be off to use session variables the way your code does. In case you haven't done this before, create .htaccess with this line: php_flag register_globals off All for me on this day. Good luck! Kirk

« previous php.general (#63795) next »