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

Add support for the SameSite cookie attribute #293

Open
ozataman opened this issue Feb 22, 2020 · 2 comments
Open

Add support for the SameSite cookie attribute #293

ozataman opened this issue Feb 22, 2020 · 2 comments

Comments

@ozataman
Copy link
Member

ozataman commented Feb 22, 2020

Chrome is now producing warnings that cross site requests will be disabled unless marked with SameSite=None in the near future. Dropping into using the cookie package is always an option but a significant inconvenience prone to mistakes.

@mightybyte
Copy link
Member

What do you think SameSite support should look like?

@jkachmar
Copy link

jkachmar commented Mar 25, 2020

I think it would probably make sense to copy what the cookie package is doing here:

  • create a SameSiteOption sum type representing the different SameSite cookie attributes
  • add cookieSameSite :: Maybe SameSiteOption to Snap's Cookie
  • chase down and resolve the resulting type errors

The difficult question, to me, is what to do about the fact that this is going to be a breaking change. There are a few paths I can think of here, but I like the following two the best:

  1. Make the above changes, hide Cookie behind smart constructors (cf. SetCookie, and release this as breaking
  2. Create a new cookie record with the SameSite attribute hidden behind smart constructors, use this new record everywhere internally, create a mapping function from the existing Cookie with a default SameSite value of None, mark the existing Cookie as deprecated, and release this as a non-breaking change
    • naming would be an issue here, since Cookie precisely captures what this structure is supposed to be and it would necessarily not be possible to change the name without incurring another breaking change in the future
    • technically deprecation notices are breaking changes, but this is bad policy and there's been an open issue to update the PVP with respect to this for years (cf. Revise deprecation clause haskell/pvp#12)

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

3 participants