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
session_set_cookie_params($sessionLifetime, '/');
session_start();
/** Refresh lifetime */
$session = session_get_cookie_params();
session_start(
array(
'name' => 'wishthis',
'cookie_lifetime' => $sessionLifetime,
)
);
setcookie(
session_name(),
session_id(),
time() + $sessionLifetime,
$session['path'],
$session['domain'],
$session['secure'],
$session['httponly']
name: session_name(),
value: session_id(),
expires_or_options: time() + $sessionLifetime,
path: '/',
domain: ''
);
/** Backwards compatibility */