SOLVED Re: [PHP] clearing a session variable

From: Date: Fri, 11 Apr 2003 16:17:08 +0000
Subject: SOLVED Re: [PHP] clearing a session variable
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-143532@lists.php.net to get a copy of this message
Matt, et al -- ..and then Matt Schroebel said... % % > -----Original Message----- % > From: David T-G [mailto:davidtg-php@justpickone.org] .. % > he can't go anywhere! Unfortunately, I haven't found how to % > really clear % > a variable so that it doesn't come back again. % % The session pw is overriding the form pw. Don't register the session % variable until your certain it matches. Or set a different session Well, that would be tricky; we actually register all of our session vars in a single include script (that does other setup) at the beginning. The answer was, logically enough, to simply unregister the session var when we see that it's incorrect. So the code changes to ... if ( $pw != "" ) { print "Invalid Password<br>\n" ; session_unregister('pw') ; } ... and we're happy. Now to implement that for a couple of other things on the site :-) % variable to control that the client has authenticated, such as % logged_in. See variable_order on this page for the explanation: % http://www.php.net/manual/en/configuration.directives.php Thanks! HAND :-D -- David T-G * There is too much animal courage in (play) davidtg@justpickone.org * society and not sufficient moral courage. (work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

« previous php.general (#143532) next »