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

Remove redundant custom SameSiteSecurity::Middleware #2628

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

floehopper
Copy link
Contributor

This was introduced in this PR in order to set SameSite=lax on all cookies. However, in the current version of Rails (v7.0.8) this is now configurable via config.action_dispatch.cookies_same_site_protection and it defaults to :lax.

I've left the CookiesSecurityTest integration test in place even though it's now testing default behaviour, because (a) it's also testing that the httponly: true option is set on the cookie store; and (b) it provides a trail back to the original PR which explains a bit about why it was introduced and links to a Trello card.

I've also double-checked in a browser that the session cookie still has SameSite=lax set.

Screenshot 2024-01-08 at 10 11 36

@chrislo chrislo self-assigned this Jan 8, 2024
This was introduced in this PR [1] in order to set `SameSite=lax` on all
cookies. However, in the current version of Rails (v7.0.8) this is now
configurable via `config.action_dispatch.cookies_same_site_protection` [2]
and it defaults to `:lax`.

I've left the `CookiesSecurityTest` integration test in place even
though it's now testing default behaviour, because (a) it's also testing
that the `httponly: true` option is set on the cookie store; and (b) it
provides a trail back to the original PR which explains a bit about why
it was introduced and links to a Trello card.

I've also double-checked in a browser that the session cookie still has
"SameSite=lax" set.

[1]: #507
[2]: https://guides.rubyonrails.org/v7.0.8/configuring.html#config-action-dispatch-cookies-same-site-protection
@floehopper floehopper force-pushed the remove-custom-same-site-security-middleware branch from ffdbdca to 340a301 Compare January 8, 2024 10:43
@floehopper floehopper merged commit b9f5c76 into main Jan 8, 2024
16 checks passed
@floehopper floehopper deleted the remove-custom-same-site-security-middleware branch January 8, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants