-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[bug] SameSiteNoneMode will not work for go versions 1.11 - 1.12 #131
Comments
Would it make more sense to update the build tags to only support this in >= 1.13? What is the benefit in using http.SameSite? |
I see the benefit in that it would be apparent to users of this lib, that support for
I think it would then be even easier to just use |
As before, the build tags specifying 1.11 was a bug. #132 also attempts to address this, albeit differently - by not having a default SameSite mode. I do want to do that going forward, as the default behaviour of this library should be to be as secure as possible. If you have older clients, you can walk it back as needed. Does your suggestion address that last part? (Frankly, I've had so little time to parse this issue, the PR, and the current state of SameSite Lax vs. None bugs out in the wild, so clarity is helpful) |
Partially resolved via #132 |
This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days. |
I found an interesting issue introduced with PR #123:
In this PR, the
type SameSiteMode
was added that mirrorstype SameSite
from go 1.13.This seems to be a bad idea, since when considering the context, it advertises support for
SameSiteNoneMode
for go versions 1.11 - 1.12.However the option
SameSiteNoneMode
has been introduced in go 1.13 and was never backported to the older versions (see the commit introducing SameSiteNoneMode at the go project).Since this package relies on
http.Cookie
andhttp.SetCookie()
, the code for actually writing out theSameSite=None
option into the cookie is simply not present in go versions 1.11 - 1.12.As a quick repro, try adding this test case to
store_test.go
and have it run with go versions 1.11 or 1.12 -- where it will fail:To prevent users from running into this issue, I think it would be best to remove the mirrored
type SameSiteMode
and to usehttp.SameSite
, instead.Alternatively, we could also close the loop by mirroring
http.Cookie.String()
andhttp.SetCookie()
from go1.13, thus adding support forSameSiteNoneMode
for the go versions where it's missing. This is something I wished would exist for gorilla/sessions. Of course, that would mean this needs to be maintained in the future.Would be happy to implement a PR -- just let me know what you think.
The text was updated successfully, but these errors were encountered: