From 7e7effefc5c2c05f25dea984b2cafea68a614b69 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 20 Dec 2023 08:37:16 +0700 Subject: [PATCH] Fixed set auth cookie issue (#1227) --- library/includes/init_bb.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index bd0ecaa79..946cc89a5 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -88,19 +88,19 @@ function bb_setcookie(string $name, mixed $val, int $lifetime = COOKIE_PERSIST, { global $bb_cfg; + $cookie = new \Josantonius\Cookie\Cookie( + domain: $bb_cfg['cookie_domain'], + expires: $lifetime, + httpOnly: $httponly, + path: $bb_cfg['script_path'], + raw: $isRaw, + sameSite: $bb_cfg['cookie_same_site'], + secure: $bb_cfg['cookie_secure'] + ); + if (!empty($val)) { - $cookie = new \Josantonius\Cookie\Cookie( - domain: $bb_cfg['cookie_domain'], - expires: $lifetime, - httpOnly: $httponly, - path: $bb_cfg['script_path'], - raw: $isRaw, - sameSite: $bb_cfg['cookie_same_site'], - secure: $bb_cfg['cookie_secure'] - ); $cookie->set($name, $val); } else { - $cookie = new \Josantonius\Cookie\Cookie(); $cookie->remove($name); } }