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

Set Removal Cookies SameSite to Lax #215

Closed
genusistimelord opened this issue Sep 21, 2023 · 3 comments
Closed

Set Removal Cookies SameSite to Lax #215

genusistimelord opened this issue Sep 21, 2023 · 3 comments

Comments

@genusistimelord
Copy link

The issue is Removal cookies don't get a Same Site setting which browsers are starting to Require Or presetting them as Lax. Inserting the Same site as Lax will prevent the Browser from displaying Warning messages and maybe Error messages later based on the action the browser take.

@SergioBenitez
Copy link
Member

SergioBenitez commented Sep 21, 2023

The treatment of cookies without a SameSite attribute is to place them inside of a "default" enforcement domain which browsers may treat differently to lax, though they should be equivalent after some arbitrarily chosen time. Irrespective of this, the latest draft RFC does not raise any concerns about removing cookies with or without SameSite attributes, and I wouldn't expect browsers to trigger a warning on cookies not containing a SameSite attribute if they have an expiration date in the past. There's no point in doing so: the cookie will never be sent anywhere, so it can't possibly pose a security threat.

Do you have any evidence to indicate that browsers do or will do otherwise?

@genusistimelord
Copy link
Author

genusistimelord commented Sep 21, 2023

I would agree with you here But here is one from firefox.
image

image2
even if its a old Cookie it still checks them. which is something I would not expect either.

Edit: So we either need to set it to Lax or SameSite=None with secure set to true. which seems to be what they are focusing on.

@SergioBenitez
Copy link
Member

SergioBenitez commented Sep 21, 2023

That feels like an issue for web browsers, not one that we should paper over here. The goal of this library is to be foundational and correct, not opinionated. For this reason, we don't arbitrarily set SameSite attributes, or any other attributes, for any cookies in this library, and I don't think we should automatically set them for removal cookies either, but this library liberally and conveniently allows setting them yourself. Should our position on that change, we can revisit this issue then. Until then, I'm closing this out.

Note: If you're using a web framework that uses this library, I would advocate that you raise an issue there. Web frameworks can be more opinionated. Rocket sets SameSite attributes automatically, for example. If it's not doing so for removal cookies, that sounds like an opportunity for improvement.

@SergioBenitez SergioBenitez closed this as not planned Won't fix, can't repro, duplicate, stale Sep 21, 2023
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