mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 21:33:54 -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,19 +88,19 @@ function bb_setcookie(string $name, mixed $val, int $lifetime = COOKIE_PERSIST,
|
||||||
{
|
{
|
||||||
global $bb_cfg;
|
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)) {
|
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);
|
$cookie->set($name, $val);
|
||||||
} else {
|
} else {
|
||||||
$cookie = new \Josantonius\Cookie\Cookie();
|
|
||||||
$cookie->remove($name);
|
$cookie->remove($name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue