Session variables not unsetting

From: Date: Sun, 05 Dec 2004 11:06:14 +0000
Subject: Session variables not unsetting
Groups: php.general 
Request: Send a blank email to php-general+get-203514@lists.php.net to get a copy of this message
I'm having a problem with session variables. A site that works fine on my local system (PHP 4.3.4) is not working on the live server (4.1.2). In both cases, register_globals is OFF. Every page starts with session_start() and I'm setting session vars by simply assigning them to $_SESSION, eg: $_SESSION['message'] = "Some message for the next page"; I have a function that is included into every page that goes like this: function show_message() { if(isset($_SESSION['message'])) { echo $_SESSION['message']; unset($_SESSION['message']); } } Calling tha function prints the message okay, but doesn't unset the session var, so once the message is set, it shows on every subsequent page until set to a different message. I even tried using session_unregister($_SESSION['message']) even though the manual says not to. What am I missing here? -- @+ Steve

« previous php.general (#203514) next »