Skip to content

Commit f2274d7

Browse files
Support sameSite=None when return response with cookies. (#4013)
Co-authored-by: 李铭昕 <715557344@qq.com>
1 parent 0f2d765 commit f2274d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Cookie/Cookie.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class Cookie
1717

1818
public const SAMESITE_STRICT = 'strict';
1919

20+
public const SAMESITE_NONE = 'none';
21+
2022
protected $name;
2123

2224
protected $value;
@@ -92,7 +94,7 @@ public function __construct(
9294
$sameSite = strtolower($sameSite);
9395
}
9496

95-
if (! in_array($sameSite, [self::SAMESITE_LAX, self::SAMESITE_STRICT, null], true)) {
97+
if (! in_array($sameSite, [self::SAMESITE_LAX, self::SAMESITE_STRICT, self::SAMESITE_NONE, null], true)) {
9698
throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.');
9799
}
98100

0 commit comments

Comments
 (0)