note 29334 added to ref.session
| From: | christian at uslfinancials dot com | Date: | Mon, 10 Feb 2003 14:12:08 +0000 |
| Subject: | note 29334 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43727@lists.php.net to get a copy of this message | ||
We were running PHP 4.1.2 to make a web app that heavy use of session vars. We made of couple of
functions that would go thru and delete session variables in masse: such as
//Function for clearing all $_SESSION variables but the
// Authentication ones
function clear_session () {
GLOBAL $_SESSION
foreach ($_SESSION as $key => $value) {
//Don't Destroy the Authenication Vars
if (!strstr($key, "AUTH")) {
$_SESSION[$key] = "";
unset($_SESSION[$key]);
}
}
}
Notice the 'GLOBAL $_SESSION' --- not needed right? Well without it the Windows PHP/Apache
Environment crashes.
If you move up to > PHP4.2.0 this kind of code will mess with your app. --- get rid of them all!
No longer needed - WAMP will no longer crash.
--
http://www.php.net/manual/en/ref.session.php
http://master.php.net/manage/user-notes.php?action=edit+29334
http://master.php.net/manage/user-notes.php?action=delete+29334
http://master.php.net/manage/user-notes.php?action=reject+29334