From 8a2962f8d9cc5a2160e82d06f2978002003e9694 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Sat, 6 Jun 2026 23:35:20 +0100 Subject: kernel: load mConfig before checkEnvironment writes to it checkEnvironment() called setConfig() to record site_server_type before mConfig had been loaded from the database. This left mConfig non-empty with only the server-type entry, so the subsequent empty() guard in loadConfig() short-circuited and site_title was never loaded. Result: getSiteCookieName() fell back to 'bit-user-bitweaver' on every request where checkEnvironment() ran first, creating a second spurious cookie alongside the real 'bit-user-' cookie and splitting sessions. Fix: call loadConfig() at the top of checkEnvironment() if mConfig is not yet populated, matching the pattern used elsewhere. The bit-user-bitweaver fallback is now only reached during a genuine cold install. Co-Authored-By: Claude Sonnet 4.6 --- includes/classes/BitSystem.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/classes/BitSystem.php b/includes/classes/BitSystem.php index 2a78ca7..f65d645 100755 --- a/includes/classes/BitSystem.php +++ b/includes/classes/BitSystem.php @@ -1699,11 +1699,13 @@ class BitSystem extends BitSingleton { if( $checked ) { return; } - + if( empty( $this->mConfig ) ) { + $this->loadConfig(); + } $errors = ''; $docroot = BIT_ROOT_PATH; - + $serverSoftware = $_SERVER['SERVER_SOFTWARE'] ?? ''; if( stripos( $serverSoftware, 'nginx' ) !== false ) { -- cgit v1.3