Gerard Samuel wrote:
Got a problem thats baffling me.
I have a form that includes a file that starts a session.
Creating sessions are no problem, but deleting the session variable is not working as its supposed to.
Sudo code ->
<?php
include('some_file.php'); // This file starts the session via session_start();
switch( $bar )
{
case 'post':
// do logic and insert into db
unset($_SESSION['foo']); // we are finished with session variable, so delete it
break;
case 'preview': // preview form contents and set session to persist $_SESSION['foo'] = 'some data'; break;
default: if (isset($_SESSION['foo'])) { unset($_SESSION['foo']); }
// display form here break; }
?>
For some reason thats beyond me, using unset() to kill the session variable isn't working.
Does anyone know what could be causing this type of behaviour??
Any help would be appreciated.
Thanks
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php