Centralize stopping session
This commit is contained in:
parent
846435aef8
commit
3f4f3454f8
|
@ -158,9 +158,7 @@ if (isset($_GET["username"]) && !class_exists("Min_DB")) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ini_bool("session.use_cookies") || @ini_set("session.use_cookies", false) !== false) { // @ - may be disabled
|
stop_session(true);
|
||||||
session_write_close(); // improves concurrency if a user opens several pages at once, may be restarted later
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_GET["username"])) {
|
if (isset($_GET["username"])) {
|
||||||
list($host, $port) = explode(":", SERVER, 2);
|
list($host, $port) = explode(":", SERVER, 2);
|
||||||
|
|
|
@ -564,12 +564,13 @@ function restart_session() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Stop session if it would be possible to restart it later
|
/** Stop session if possible
|
||||||
|
* @param bool
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function stop_session() {
|
function stop_session($force = false) {
|
||||||
if (!ini_bool("session.use_cookies")) {
|
if (!ini_bool("session.use_cookies") || ($force && @ini_set("session.use_cookies", false) !== false)) { // @ - may be disabled
|
||||||
session_write_close();
|
session_write_close(); // improves concurrency if a user opens several pages at once, may be restarted later
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue