Skip to content

Commit

Permalink
Allow set 'None' on samesite cookie flag
Browse files Browse the repository at this point in the history
Allow set samesite cookie flag to 'None' value
  • Loading branch information
markitosgv committed May 10, 2019
1 parent c717083 commit 8bac3d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Symfony/Component/HttpFoundation/Cookie.php
Expand Up @@ -28,6 +28,7 @@ class Cookie
private $raw;
private $sameSite;

const SAMESITE_NONE = 'none';
const SAMESITE_LAX = 'lax';
const SAMESITE_STRICT = 'strict';

Expand Down Expand Up @@ -128,7 +129,7 @@ public function __construct($name, $value = null, $expire = 0, $path = '/', $dom
$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.');
}

Expand Down

0 comments on commit 8bac3d6

Please sign in to comment.