Attempt to enable persistent sessions

This commit is contained in:
grandeljay 2022-09-22 11:35:48 +02:00
parent c86865bc61
commit 3caa71a6c5

View file

@ -42,20 +42,18 @@ spl_autoload_register(
*/ */
$sessionLifetime = 2592000 * 12; // 12 Months $sessionLifetime = 2592000 * 12; // 12 Months
session_set_cookie_params($sessionLifetime, '/'); session_start(
session_start(); array(
'name' => 'wishthis',
/** Refresh lifetime */ 'cookie_lifetime' => $sessionLifetime,
$session = session_get_cookie_params(); )
);
setcookie( setcookie(
session_name(), name: session_name(),
session_id(), value: session_id(),
time() + $sessionLifetime, expires_or_options: time() + $sessionLifetime,
$session['path'], path: '/',
$session['domain'], domain: ''
$session['secure'],
$session['httponly']
); );
/** Backwards compatibility */ /** Backwards compatibility */