Re: Control over your Session
| From: | Leif K-Brooks | Date: | Mon, 10 Mar 2003 08:12:17 +0000 |
| Subject: | Re: Control over your Session | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-138929@lists.php.net to get a copy of this message | ||
If you have register_globals on, you'll need to session_unregister it.
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'])) {-- 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.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