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

Feature request: configurable behaviour for cookie defaults and overrides #2

Open
rowan-m opened this issue Nov 9, 2019 · 2 comments

Comments

@rowan-m
Copy link

rowan-m commented Nov 9, 2019

By applying SameSite=None; Secure to all cookies you do have the benefit of maintaining their legacy behaviour, however it does mean that you're explicitly marking all cookies for cross-site use. While this may be necessary for API auth related cookies, it's probably not needed for the majority of site cookies. It would be nice to provide configuration that enabled the following:

  • A map of cookie names to the SameSite attribute value to be applied
  • A boolean option for if the mapped SameSite value should override an existing value
  • A default value for the SameSite attribute to apply when missing
  • A boolean option to remove invalid SameSite values from cookies

For example, this would allow a developer to specify their auth cookie for the SameSite=None; Secure attributes, but apply a SameSite=Lax policy by default to everything else.

@pschinis
Copy link
Owner

I don't have a lot of bandwidth to add more configuration options at the moment, but hopefully should have some time before Chrome's changes go live in February. Otherwise the code is pretty simple so feel free to submit a pull request.

@synth
Copy link

synth commented Mar 21, 2020

To add to the configurable behavior, we'd love to see request level configuration. Our app has lots of integrations that are implemented via iFrames (eg Sharepoint, Microsoft Teams, etc). For requests coming from those integrations (which can be validated), we'd like to remove the samesite restriction, but for other requests, we'd like to have the lax or strict setting.

#15 takes a stab at accomplishing but unsure if that implementation is the best.

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