Re: Destroying a Session

From: Date: Wed, 25 Aug 2004 11:45:15 +0000
Subject: Re: Destroying a Session
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-194666@lists.php.net to get a copy of this message
On Wed, 2004-08-25 at 14:34, Shaun wrote: > I am writing a shopping cart and am using a session called > $_SESSION["orderinfo"] to store the order information. I also have a > function I use to clear the session when the payment has been authorized: > > 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? You do have a session_start() somewhere, right? Also, $_SESSION, like $_GET, $_POST et. al. are automatically global, you don't need to specify global $_SESSION.

« previous php.general (#194666) next »