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

Firefox complains about cookie same site attribute #77

Closed
fosterfarrell9 opened this issue Sep 16, 2020 · 2 comments
Closed

Firefox complains about cookie same site attribute #77

fosterfarrell9 opened this issue Sep 16, 2020 · 2 comments

Comments

@fosterfarrell9
Copy link
Collaborator

Apparently, there is a problem with our cookies and their same site attribute. In the future, these cookies will be declined.

@fosterfarrell9
Copy link
Collaborator Author

I alreay tried this and this gem to fix the issue, but none of them worked.

@henrixapp
Copy link
Collaborator

Adding an initializer config/initializers/session_store.rbwith the following content:

Rails.application.config.session_store :cookie_store, key: '_mampf_session', same_site: :strict

Fixes the issue for the (most important) session cookie. For the other cookies I would suggest adding a "helper" in application_controller.rb:

  def strict_cookie(val)
    {
        value: val,
        same_site: "Strict"
    }
  end

and calling it like this:

cookies[:locale] = strict_cookie(I18n.locale)

instead of

cookies[:locale] = I18n.locale

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

No branches or pull requests

2 participants