summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-10-14 22:50:45 +0300
committerAndrew Dolgov <[email protected]>2018-10-14 22:50:45 +0300
commitec5687a62b706f3ee91eb21aaeea278fcaa994bc (patch)
tree26e44629f6eb21377b4c1e94e861911c279a7eee /include
parentf287596f0fe2a4f86bac7c784225ab0892b1d1c7 (diff)
logout user: commit destroyed session
Diffstat (limited to 'include')
-rwxr-xr-xinclude/functions.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/functions.php b/include/functions.php
index be0d4e262..d88e96dd6 100755
--- a/include/functions.php
+++ b/include/functions.php
@@ -811,10 +811,11 @@
}
function logout_user() {
- session_destroy();
+ @session_destroy();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
+ session_commit();
}
function validate_csrf($csrf_token) {
@@ -856,8 +857,7 @@
}
if (!$_SESSION["uid"]) {
- @session_destroy();
- setcookie(session_name(), '', time()-42000, '/');
+ logout_user();
render_login_form();
exit;