I have a login functionality in which I initiate a new session with the code below. The problem is that - mostly on Android/Chrome - the session parameter $_SESSION['hashed_pw'] that is set in a "function login" and is used to control the login status gets lots after a few hours even though I don't want the session to expire at all. Can somebody help me with this?
Thanks, Frank
function sec_session_start() {
$session_name = 'sec_session_id'; // vergib einen Sessionnamen
$secure = SECURE;
// Damit wird verhindert, dass JavaScript auf die session id zugreifen kann.
$httponly = true;
// Zwingt die Sessions nur Cookies zu benutzen.
if (ini_set('session.use_only_cookies', 1) === FALSE) {
header("Location: ../error.php?err=Could not initiate a safe session (ini_set)");
exit();
}
// Holt Cookie-Parameter.
$cookieParams = session_get_cookie_params();
session_set_cookie_params(999999,
$cookieParams["path"],
$cookieParams["domain"],
$secure,
$httponly);
// Setzt den Session-Name zu oben angegebenem.
session_name($session_name);
session_cache_limiter(4320);
session_start(); // Startet die PHP-Sitzung
session_regenerate_id(); // Erneuert die Session, löscht die alte.
}