fix session/cookie domain value

Signed-off-by: Maurice Preuß (envoyr) <envoyr@froxlor.org>
This commit is contained in:
Maurice Preuß (envoyr) 2023-01-25 18:41:52 +01:00
parent 056b7a7488
commit 821a14b8cd
No known key found for this signature in database
GPG Key ID: 5A16F49AF96F462F
2 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ class UI
session_set_cookie_params([
'lifetime' => self::$install_mode ? 7200 : 600, // will be renewed based on settings in lib/init.php
'path' => '/',
'domain' => $_SERVER['SERVER_NAME'],
'domain' => explode(':', $_SERVER['HTTP_HOST'])[0],
'secure' => self::requestIsHttps(),
'httponly' => true,
'samesite' => 'Strict'

View File

@ -335,7 +335,7 @@ if (CurrentUser::hasSession()) {
$cookie_params = [
'expires' => time() + Settings::Get('session.sessiontimeout'),
'path' => '/',
'domain' => $_SERVER['SERVER_NAME'],
'domain' => explode(':', $_SERVER['HTTP_HOST'])[0],
'secure' => UI::requestIsHttps(),
'httponly' => true,
'samesite' => 'Strict'