From cc6d8d5f8b3aafee839a746b992ed289420e67f4 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Tue, 10 Jan 2023 12:43:04 +0100 Subject: [PATCH] fix login if non-standard ports are used for froxlor vhost Signed-off-by: Michael Kaufmann --- lib/Froxlor/UI/Panel/UI.php | 2 +- lib/init.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Froxlor/UI/Panel/UI.php b/lib/Froxlor/UI/Panel/UI.php index da9291ac..7ddddd9d 100644 --- a/lib/Froxlor/UI/Panel/UI.php +++ b/lib/Froxlor/UI/Panel/UI.php @@ -95,7 +95,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['HTTP_HOST'], + 'domain' => $_SERVER['SERVER_NAME'], 'secure' => self::requestIsHttps(), 'httponly' => true, 'samesite' => 'Strict' diff --git a/lib/init.php b/lib/init.php index c5d65163..5bf42af6 100644 --- a/lib/init.php +++ b/lib/init.php @@ -332,7 +332,7 @@ if (CurrentUser::hasSession()) { $cookie_params = [ 'expires' => time() + Settings::Get('session.sessiontimeout'), 'path' => '/', - 'domain' => $_SERVER['HTTP_HOST'], + 'domain' => $_SERVER['SERVER_NAME'], 'secure' => UI::requestIsHttps(), 'httponly' => true, 'samesite' => 'Strict'