note 69603 added to function.session-destroy
| From: | wrong at andright dot com | Date: | Tue, 12 Sep 2006 13:10:41 +0000 |
| Subject: | note 69603 added to function.session-destroy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-117062@lists.php.net to get a copy of this message | ||
$_SESSION is the only superglobal whose uninitialized value is not that of an empty array but that
of NULL. If there is no reason behind it, I don't know, but I assume there is.
Therefore, destroy a $_SESSION by assigning to it NULL.
The rationale behind assinging to it array() is that your codes may have loops in it that scan a
destroyed session.
The fact is, your codes should not have such loops in the first place. A code that loops a destroyed
session, is a terribly bad code and no solutions that encourage terribly bad coding prcatices should
be sponsored.
$_SESSION=null
is the _compliant_ way to go. It will pass all tests, included isset($_SESSION).
----
Server IP: 80.241.173.254
Probable Submitter: 84.221.110.198
----
Manual Page -- http://www.php.net/manual/en/function.session-destroy.php
Edit -- https://master.php.net/note/edit/69603
Del: integrated -- https://master.php.net/note/delete/69603/integrated
Del: useless -- https://master.php.net/note/delete/69603/useless
Del: bad code -- https://master.php.net/note/delete/69603/bad+code
Del: spam -- https://master.php.net/note/delete/69603/spam
Del: non-english -- https://master.php.net/note/delete/69603/non-english
Del: in docs -- https://master.php.net/note/delete/69603/in+docs
Del: other reasons-- https://master.php.net/note/delete/69603
Reject -- https://master.php.net/note/reject/69603
Search -- https://master.php.net/manage/user-notes.php