From bd401e50a8ee87aff424d3f85412e244dd0ebd0f Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 16 Dec 2025 13:02:08 -0500 Subject: [PATCH] fix: Use session name when setting SID parameter Restore the original behavior by checking session cookie. --- lib/Horde/PageOutput.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/Horde/PageOutput.php b/lib/Horde/PageOutput.php index a10d2f3e..95e0e4ae 100644 --- a/lib/Horde/PageOutput.php +++ b/lib/Horde/PageOutput.php @@ -650,7 +650,16 @@ public function header(array $opts = []) if ($this->ajax || $this->growler) { $this->addScriptFile(new Horde_Script_File_JsFramework('hordecore.js', 'horde')); - $session_id = session_id(); + $session_name = session_name(); + if (isset($_COOKIE[$session_name])) { + $SID = ''; + } else { + $SID = session_id(); + if ($SID) { + $SID = $session_name . '=' . $SID; + } + } + /* Configuration used in core javascript files. */ $js_conf = array_filter([ /* URLs */ @@ -660,7 +669,7 @@ public function header(array $opts = []) 'URI_SNOOZE' => strval(Horde::url($registry->get('webroot', 'horde') . '/services/snooze.php', true, -1)), /* Other constants */ - 'SID' => $session_id ? 'name=' . $session_id : '', + 'SID' => $SID, 'TOKEN' => $session->getToken(), /* Other config. */