Skip to content

Commit

Permalink
Merge pull request #3042 from arneee/patch-1
Browse files Browse the repository at this point in the history
Allow "none" as SameSite value in cookies
  • Loading branch information
l0gicgate committed Mar 2, 2021
2 parents 5ca71b9 + 54d9ef3 commit 5850aae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Slim/Http/Cookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ protected function toHeader($name, array $properties)
$result .= '; HttpOnly';
}

if (isset($properties['samesite']) && in_array(strtolower($properties['samesite']), ['lax', 'strict'], true)) {
if (isset($properties['samesite'])
&& in_array(strtolower($properties['samesite']), ['lax', 'strict', 'none'], true)) {
// While strtolower is needed for correct comparison, the RFC doesn't care about case
$result .= '; SameSite=' . $properties['samesite'];
}
Expand Down

0 comments on commit 5850aae

Please sign in to comment.