From: moodler Date: Sat, 17 May 2003 04:45:52 +0000 (+0000) Subject: Hopefully this will fix the logout problems - it now specifically X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=eab79dc13deae43187c399aa5dbe628b60f48aad;p=moodle.git Hopefully this will fix the logout problems - it now specifically checks for PHP 4.3.0 or later, and also does the unset anyway. Sessions are not consistent in PHP versions. --- diff --git a/login/logout.php b/login/logout.php index 27a868be1e..09e9fddb2e 100644 --- a/login/logout.php +++ b/login/logout.php @@ -3,14 +3,15 @@ require_once("../config.php"); - if (ini_get_bool("register_globals")) { - // This method is to try to avoid silly warnings from PHP 4.3.0 - session_unregister("SESSION"); + if (ini_get_bool("register_globals") and check_php_version("4.3.0")) { + // This method is just to try to avoid silly warnings from PHP 4.3.0 session_unregister("USER"); - } else { - unset($_SESSION['USER']); - unset($_SESSION['SESSION']); + session_unregister("SESSION"); } + + unset($_SESSION['USER']); + unset($_SESSION['SESSION']); + redirect($CFG->wwwroot); ?>