1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-17 12:00:41 +02:00

Improve session management

This commit is contained in:
Jakub Vrana
2012-08-19 13:42:13 -07:00
parent c9da3ccb51
commit 5e0038b62d
6 changed files with 16 additions and 8 deletions

View File

@@ -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
}

View File

@@ -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 "<div class='error'>$error</div>\n";
}

View File

@@ -396,6 +396,15 @@ function restart_session() {
}
}
/** Stop session if it would be possible to restart it later
* @return null
*/
function stop_session() {
if (!ini_bool("session.use_cookies")) {
session_write_close();
}
}
/** Get session variable for current server
* @param string
* @return mixed