bug 1176: Fix Session cleanup
authorBenny Baumann <BenBE@geshi.org>
Mon, 13 May 2013 20:50:06 +0000 (22:50 +0200)
committerBenny Baumann <BenBE@geshi.org>
Mon, 13 May 2013 20:50:06 +0000 (22:50 +0200)
includes/loggedin.php

index 5734fad..b17f079 100644 (file)
                $uid = $_SESSION['profile']['id'];
                $_SESSION['profile']['loggedin'] = 0;
                $_SESSION['profile'] = "";
-               foreach($_SESSION as $key)
+               foreach($_SESSION as $key => $value)
                {
                        if($key == '_config')
                                continue;
                        if(is_int($key) || is_string($key))
                                unset($_SESSION[$key]);
-                       unset($$key);
-                       session_unregister($key);
+                       unset($$key);
+                       //session_unregister($key);
                }
 
                $_SESSION['profile'] = mysql_fetch_assoc(mysql_query("select * from `users` where `id`='$uid'"));
                {
                        $_SESSION['profile']['loggedin'] = 0;
                        $_SESSION['profile'] = "";
-                       foreach($_SESSION as $key)
+                       foreach($_SESSION as $key => $value)
                        {
                                if($key == '_config')
                                        continue;
                                if(is_int($key) || is_string($key))
                                        unset($_SESSION[$key]);
-                               unset($$key);
-                                       session_unregister($key);
+                               unset($$key);
+                               //session_unregister($key);
                        }
 
                        $_SESSION['profile'] = mysql_fetch_assoc(mysql_query(
                } else {
                        $_SESSION['profile']['loggedin'] = 0;
                        $_SESSION['profile'] = "";
-                       foreach($_SESSION as $key)
+                       foreach($_SESSION as $key => $value)
                        {
                                if($key == '_config')
                                        continue;
-                               unset($_SESSION[$key]);
-                               unset($$key);
-                               session_unregister($key);
+                               unset($_SESSION[$key]);
+                               unset($$key);
+                               //session_unregister($key);
                        }
 
                        unset($_SESSION['_config']['oldlocation']);
                $_SESSION['profile'] = "";
                foreach($_SESSION as $key => $value)
                {
-                       unset($_SESSION[$key]);
-                       unset($$key);
-                       session_unregister($key);
+                       unset($_SESSION[$key]);
+                       unset($$key);
+                       //session_unregister($key);
                }
 
                header("location: https://".$normalhost."/index.php");