note 69603 deleted from function.session-destroy by bjori

From: Date: Tue, 05 Dec 2006 12:17:44 +0000
Subject: note 69603 deleted from function.session-destroy by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-120293@lists.php.net to get a copy of this message
Note Submitter: wrong at andright dot com ---- $_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).

« previous php.notes (#120293) next »