Set session cookie parameters for improved security and lifetime management in bootstrap.php

This commit is contained in:
Fabian Schieder 2026-03-30 20:04:07 +02:00
parent 6e4d725018
commit b82b4ca35a

View File

@ -16,6 +16,15 @@ error_reporting(E_ALL);
if (session_status() !== PHP_SESSION_ACTIVE) if (session_status() !== PHP_SESSION_ACTIVE)
{ {
// Session-Cookie Lifetime auf 30 Tage setzen
session_set_cookie_params([
'lifetime' => 60 * 60 * 24 * 30, // 30 days
'path' => '/',
'domain' => '',
'secure' => false,
'httponly' => true,
'samesite' => 'Lax'
]);
session_start(); session_start();
} }