diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 41c685c5..dce1433e 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -271,11 +271,13 @@ if (!defined("DRIVER")) { $return = &get_session("dbs"); if ($return === null) { if ($flush) { - restart_session(); ob_flush(); flush(); } - $return = get_vals($connection->server_info >= 5 ? "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA" : "SHOW DATABASES"); // SHOW DATABASES can be disabled by skip_show_database + $databases = get_vals($connection->server_info >= 5 ? "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA" : "SHOW DATABASES"); // SHOW DATABASES can be disabled by skip_show_database + restart_session(); + $return = $databases; + stop_session(); } return $return; } diff --git a/adminer/include/bootstrap.inc.php b/adminer/include/bootstrap.inc.php index e9d787fd..48a36dd1 100644 --- a/adminer/include/bootstrap.inc.php +++ b/adminer/include/bootstrap.inc.php @@ -76,8 +76,8 @@ include "../adminer/include/auth.inc.php"; include "./include/connect.inc.php"; include "./include/editing.inc.php"; -session_cache_limiter(""); // to allow restarting session if (!ini_bool("session.use_cookies") || @ini_set("session.use_cookies", false) !== false) { // @ - may be disabled + session_cache_limiter(""); // to allow restarting session session_write_close(); // improves concurrency if a user opens several pages at once, may be restarted later } diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 4fb81df5..6bbcf564 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -77,6 +77,7 @@ document.body.className = document.body.className.replace(/ nojs/, ' js'); if (DB != "" && $databases && !in_array(DB, $databases, true)) { $databases = null; } + stop_session(); if ($error) { echo "