Allow set 'None' on samesite cookie flag
Allow set samesite cookie flag to 'None' value
This commit is contained in:
parent
c717083d84
commit
8bac3d6fa3
@ -28,6 +28,7 @@ class Cookie
|
|||||||
private $raw;
|
private $raw;
|
||||||
private $sameSite;
|
private $sameSite;
|
||||||
|
|
||||||
|
const SAMESITE_NONE = 'none';
|
||||||
const SAMESITE_LAX = 'lax';
|
const SAMESITE_LAX = 'lax';
|
||||||
const SAMESITE_STRICT = 'strict';
|
const SAMESITE_STRICT = 'strict';
|
||||||
|
|
||||||
@ -128,7 +129,7 @@ class Cookie
|
|||||||
$sameSite = strtolower($sameSite);
|
$sameSite = strtolower($sameSite);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!\in_array($sameSite, [self::SAMESITE_LAX, self::SAMESITE_STRICT, null], true)) {
|
if (!\in_array($sameSite, [self::SAMESITE_LAX, self::SAMESITE_STRICT, self::SAMESITE_NONE, null], true)) {
|
||||||
throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.');
|
throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user