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

Allow opting out of the SameSite cookie attribute when setting a cookie #45501

Merged
merged 1 commit into from
Jul 5, 2022

Commits on Jul 3, 2022

  1. Allow opting out of the SameSite cookie attribute when setting a co…

    …okie.
    
    Since rails@7ccaa12 it's not been possible to not include `SameSite` on your cookies. `SameSite` is recommended, but it's not a required field, and you should be able to opt out of it.
    
    This PR introduces that ability: you can opt out of `SameSite` by passing `same_site: false`.
    
    ```ruby
    cookies[:foo] = { value: "bar", same_site: false }
    ```
    
    Previously, this incorrectly set the `SameSite` attribute to the value of the `cookies_same_site_protection` setting. rails#44934 added docs saying that you could pass `nil` as a value, but that also would fall back to the default (`:lax`).
    ghiculescu committed Jul 3, 2022
    Configuration menu
    Copy the full SHA
    d29e755 View commit details
    Browse the repository at this point in the history