From 876af58944b3cf09e08976bb426236a2dd7ae53b Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 29 Dec 2010 18:15:42 +0100 Subject: [PATCH] Fix sid function --- adminer/include/functions.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 8de6481b..41e597dd 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -165,7 +165,11 @@ function ini_bool($ini) { * @return bool */ function sid() { - return (SID && !($_COOKIE && ini_bool("session.use_cookies"))); // $_COOKIE - don't pass SID with permanent login + static $return; + if (!isset($return)) { // restart_session() defines SID + $return = (SID && !($_COOKIE && ini_bool("session.use_cookies"))); // $_COOKIE - don't pass SID with permanent login + } + return $return; } /** Shortcut for $connection->quote($string)