update
All checks were successful
Deploy / deploy-staging (push) Successful in 26s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-25 23:41:32 +02:00
parent 44d9aa0969
commit 28fc759399

View File

@@ -27,7 +27,38 @@ if (!function_exists('desktop_configure_session_storage')) {
}
}
if (!function_exists('desktop_configure_session_cookie')) {
function desktop_configure_session_cookie(): void
{
if (session_status() === PHP_SESSION_ACTIVE) {
return;
}
session_name('desktop_kusche_sid');
$isHttps = false;
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') {
$isHttps = true;
}
$forwardedProto = trim((string) ($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? ''));
if ($forwardedProto !== '') {
$isHttps = strtolower(trim(explode(',', $forwardedProto)[0] ?? '')) === 'https';
}
session_set_cookie_params([
'lifetime' => 0,
'path' => '/',
'domain' => '',
'secure' => $isHttps,
'httponly' => true,
'samesite' => 'Lax',
]);
}
}
desktop_configure_session_storage();
desktop_configure_session_cookie();
spl_autoload_register(static function (string $class): void {
$prefixes = [