mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 13:24:01 -07:00
Fixed set auth cookie issue (#1227)
This commit is contained in:
parent
243d251066
commit
7e7effefc5
1 changed files with 10 additions and 10 deletions
|
@ -88,7 +88,6 @@ function bb_setcookie(string $name, mixed $val, int $lifetime = COOKIE_PERSIST,
|
|||
{
|
||||
global $bb_cfg;
|
||||
|
||||
if (!empty($val)) {
|
||||
$cookie = new \Josantonius\Cookie\Cookie(
|
||||
domain: $bb_cfg['cookie_domain'],
|
||||
expires: $lifetime,
|
||||
|
@ -98,9 +97,10 @@ function bb_setcookie(string $name, mixed $val, int $lifetime = COOKIE_PERSIST,
|
|||
sameSite: $bb_cfg['cookie_same_site'],
|
||||
secure: $bb_cfg['cookie_secure']
|
||||
);
|
||||
|
||||
if (!empty($val)) {
|
||||
$cookie->set($name, $val);
|
||||
} else {
|
||||
$cookie = new \Josantonius\Cookie\Cookie();
|
||||
$cookie->remove($name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue