note 34437 added to function.unset
| From: | frederic dot royet at logipro dot com | Date: | Sun, 27 Jul 2003 11:22:48 +0000 |
| Subject: | note 34437 added to function.unset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52741@lists.php.net to get a copy of this message | ||
Big probleme to unset session variables. Specially object.
I had an object in the session:
1st page
$caddie = new Caddie();
$_SESSION["caddie"]
2nd page: i want to unregister it from the session (PHP 4.2 with register_globals=On)
Following try hadn't worked:
1)
unset($_SESSION["caddie"])
2)
unset($_SESSION["caddie"],$caddie)
3)
$caddie=$_SESSION["caddie"]
session_unregister($caddie)
I tried:
$_SESSION["caddie"]=null
I worked!!!
Why ?, Is it a good solution ?
----
Manual Page -- http://www.php.net/manual/en/function.unset.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34437
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34437&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34437&report=yes