diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index a185d5da2..878fa9ac0 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -321,7 +321,7 @@ class Context $lang_type = preg_replace('/[^a-zA-Z0-9_-]/', '', $lang_type ?? ''); if ($set_lang_cookie) { - Rhymix\Framework\Cookie::set('lang_type', $lang_type, ['expires' => 365]); + Rhymix\Framework\Cookie::set('lang_type', $lang_type, ['expires' => 365, 'path' => \RX_BASEURL]); } if(!$lang_type || !isset($enabled_langs[$lang_type])) diff --git a/classes/mobile/Mobile.class.php b/classes/mobile/Mobile.class.php index 49e5b91e0..8e96adc07 100644 --- a/classes/mobile/Mobile.class.php +++ b/classes/mobile/Mobile.class.php @@ -72,7 +72,7 @@ class Mobile $uatype = $uahash . ':' . (self::$_ismobile ? '1' : '0'); if ($cookie !== $uatype) { - Rhymix\Framework\Cookie::set('rx_uatype', $uatype, ['expires' => 0]); + Rhymix\Framework\Cookie::set('rx_uatype', $uatype, ['expires' => 0, 'path' => \RX_BASEURL]); } return self::$_ismobile; diff --git a/common/framework/Cookie.php b/common/framework/Cookie.php index c9d7926b7..997b39410 100644 --- a/common/framework/Cookie.php +++ b/common/framework/Cookie.php @@ -60,7 +60,7 @@ class Cookie // Set defaults. if (!array_key_exists('path', $options)) { - $options['path'] = config('cookie.path') ?? \RX_BASEURL; + $options['path'] = config('cookie.path') ?? '/'; } if (!array_key_exists('domain', $options) && ($default_domain = config('cookie.domain'))) { @@ -87,7 +87,7 @@ class Cookie else { $expires = $options['expires']; - $path = $options['path'] ?? \RX_BASEURL; + $path = $options['path'] ?? '/'; $domain = $options['domain'] ?? null; $secure = $options['secure'] ?? false; $httponly = $options['httponly'] ?? false; diff --git a/common/framework/UA.php b/common/framework/UA.php index 573af9d51..136a44ed5 100644 --- a/common/framework/UA.php +++ b/common/framework/UA.php @@ -470,7 +470,7 @@ class UA { if (in_array($color_scheme, ['light', 'dark'])) { - Cookie::set('rx_color_scheme', $color_scheme, ['expires' => 365]); + Cookie::set('rx_color_scheme', $color_scheme, ['expires' => 365, 'path' => \RX_BASEURL]); } else { diff --git a/modules/ncenterlite/ncenterlite.controller.php b/modules/ncenterlite/ncenterlite.controller.php index 544d2f79e..e9e48f291 100644 --- a/modules/ncenterlite/ncenterlite.controller.php +++ b/modules/ncenterlite/ncenterlite.controller.php @@ -1122,7 +1122,7 @@ class NcenterliteController extends Ncenterlite } if(!empty($_COOKIE['_ncenterlite_hide_id'])) { - Rhymix\Framework\Cookie::remove('_ncenterlite_hide_id', ['path' => '/']); + Rhymix\Framework\Cookie::remove('_ncenterlite_hide_id'); } $oMemberModel = getModel('member');