diff --git a/CRM/Utils/System/Standalone.php b/CRM/Utils/System/Standalone.php index b05512cf1a0f..cd98a608f177 100644 --- a/CRM/Utils/System/Standalone.php +++ b/CRM/Utils/System/Standalone.php @@ -553,8 +553,18 @@ public function permissionDenied() { * Start a new session. */ public function sessionStart() { - $session_handler = new SessionHandler(); - session_set_save_handler($session_handler); + if (defined('CIVI_SETUP')) { + // during installation we can't use the session + // handler from the extension yet so we just + // use a default php session + // use a different cookie name to avoid any nasty clash + $session_cookie_name = 'SESSCIVISOINSTALL'; + } + else { + $session_handler = new SessionHandler(); + session_set_save_handler($session_handler); + $session_cookie_name = 'SESSCIVISO'; + } $session_max_lifetime = Civi::settings()->get('standaloneusers_session_max_lifetime') ?? 1440; @@ -562,7 +572,7 @@ public function sessionStart() { 'cookie_httponly' => 1, 'cookie_secure' => !empty($_SERVER['HTTPS']), 'gc_maxlifetime' => $session_max_lifetime, - 'name' => 'SESSCIVISO', + 'name' => $session_cookie_name, 'use_cookies' => 1, 'use_only_cookies' => 1, 'use_strict_mode' => 1,