prolong PHP session cookie automatically to stop hard logouts after SESSION_COOKIE_LIFETIME expires

This commit is contained in:
Andrew Dolgov 2021-06-25 12:12:05 +03:00
parent cd26dbe64c
commit 44c5d0feba
1 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,16 @@
ini_set("session.gc_maxlifetime", $session_expire);
ini_set("session.cookie_lifetime", "0");
// prolong PHP session cookie
if (isset($_COOKIE[$session_name]))
setcookie($session_name,
$_COOKIE[$session_name],
time() + $session_expire,
ini_get("session.cookie_path"),
ini_get("session.cookie_domain"),
ini_get("session.cookie_secure"),
ini_get("session.cookie_httponly"));
function validate_session() {
if (\Config::get(\Config::SINGLE_USER_MODE)) return true;