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:
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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";
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user