Re: Destroying a Session

From: Date: Wed, 25 Aug 2004 12:07:53 +0000
Subject: Re: Destroying a Session
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-194667@lists.php.net to get a copy of this message
>> function clear_orderinfo() { >> global $_SESSION; >> unset($_SESSION["orderinfo"]); >> } >> >> However this function doesnt seem to work and the session remains >> active, is >> there another way to clear a session? I'm not triffically experienced, but I do have notes on the subject. You're wanting to clear the whole session, right? $_SESSION=array(); session_destroy(); For specific variables, try assigning FALSE to it ($_SESSION['name']=FALSE; or 'unset' works for versions >=4.2.2. Otherwise use session_unregister. For me under 4.1.2 I had to set to null. HTH J

« previous php.general (#194667) next »