session_destroy();

From: Date: Fri, 11 Aug 2000 09:31:44 +0000
Subject: session_destroy();
Groups: php.general 
Request: Send a blank email to php-general+get-11292@lists.php.net to get a copy of this message
Hello all, Richard and the Sessions of Doom, chapter 2: I have the following code at the top of my page: session_start(); /* check the session exists. If not, register the $CART array as a session variable. If for some reason the session exists, but the $CART array doesn't, create it */ if(!$PHPSESSID) { session_register("CART"); $CART = array(); //set CART to an array } elseif(!$CART) { $CART = array(); } then, when I'm done with the session, I call: session_start(); // call up the session data session_destroy(); // destroy it all This works in so far as the session runs beautifully, and ends exactly where I want it to. The problem I'm having is that once you have destroyed the session you can't then start a new one without exiting the browser (not just closing the window, but an actual full on "shut down Netscape and start again" deal). Does anyone know how I can overcome this annoyance? Cheers, Richard "Kids are smarter than any adults I've ever met. I know this because I've never met a kid with a full time job, and kids." Bill Hicks

« previous php.general (#11292) next »