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


--
Gerard Samuel
http://www.trini0.org:81/
http://test1.trini0.org:81/



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to