Skip to content

Commit 1a13e4d

Browse files
committed
Add case-insensitive validation of SameSite
1 parent 2cc7775 commit 1a13e4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

system/Cookie/Cookie.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,11 +766,11 @@ protected function validateSameSite(string $samesite, bool $secure): void
766766
$samesite = self::SAMESITE_LAX;
767767
}
768768

769-
if (! in_array($samesite, self::ALLOWED_SAMESITE_VALUES, true)) {
769+
if (! in_array(ucfirst(strtolower($samesite)), self::ALLOWED_SAMESITE_VALUES, true)) {
770770
throw CookieException::forInvalidSameSite($samesite);
771771
}
772772

773-
if ($samesite === self::SAMESITE_NONE && ! $secure) {
773+
if (ucfirst(strtolower($samesite)) === self::SAMESITE_NONE && ! $secure) {
774774
throw CookieException::forInvalidSameSiteNone();
775775
}
776776
}

0 commit comments

Comments
 (0)