prolong PHP session cookie automatically to stop hard logouts after SESSION_COOKIE_LIFETIME expires
This commit is contained in:
parent
cd26dbe64c
commit
44c5d0feba
|
@ -19,6 +19,16 @@
|
||||||
ini_set("session.gc_maxlifetime", $session_expire);
|
ini_set("session.gc_maxlifetime", $session_expire);
|
||||||
ini_set("session.cookie_lifetime", "0");
|
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() {
|
function validate_session() {
|
||||||
if (\Config::get(\Config::SINGLE_USER_MODE)) return true;
|
if (\Config::get(\Config::SINGLE_USER_MODE)) return true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue