mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Added 'samesite' option for setcookie() (#720)
This commit is contained in:
parent
47c3a1dd20
commit
5ae2d9ee89
2 changed files with 5 additions and 0 deletions
|
@ -74,6 +74,8 @@ define('COOKIE_PERSIST', TIMENOW + 31536000);
|
|||
define('COOKIE_MAX_TRACKS', 90);
|
||||
|
||||
/**
|
||||
* Set cookie
|
||||
*
|
||||
* @param $name
|
||||
* @param $val
|
||||
* @param int $lifetime
|
||||
|
@ -83,12 +85,14 @@ define('COOKIE_MAX_TRACKS', 90);
|
|||
function bb_setcookie($name, $val, int $lifetime = COOKIE_PERSIST, bool $httponly = false)
|
||||
{
|
||||
global $bb_cfg;
|
||||
|
||||
return setcookie($name, $val, [
|
||||
'expires' => $lifetime,
|
||||
'path' => $bb_cfg['script_path'],
|
||||
'domain' => $bb_cfg['cookie_domain'],
|
||||
'secure' => $bb_cfg['cookie_secure'],
|
||||
'httponly' => $httponly,
|
||||
'samesite' => $bb_cfg['cookie_same_site'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue