Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2157, Explicitly set SameSite value for cookies #2159

Merged
merged 5 commits into from
Jun 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update src/Http/CookieFactory.php
Co-authored-by: Daniël Klabbers <luceos@users.noreply.github.com>
  • Loading branch information
tankerkiller125 and luceos authored May 15, 2020
commit 471787e6fb0fdfdaf955cd6bb8dc8ac49fd3e416
8 changes: 1 addition & 7 deletions src/Http/CookieFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,7 @@ public function make($name, $value = null, $maxAge = null)
}

// Explicitly set SameSite value, use sensible default if no value provided
if ($this->samesite === 'strict') {
$cookie = $cookie->withSameSite(SameSite::strict());
} elseif ($this->samesite === 'none') {
$cookie = $cookie->withSameSite(SameSite::none());
} else {
$cookie = $cookie->withSameSite(SameSite::lax());
}
$cookie = $cookie->withSameSite(forward_static_call([SameSite, $this->samesite ?? 'lax']));

return $cookie
->withPath($this->path)
Expand Down