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

Cookie with SameSite=None requires Secure #25

Open
ipoerner opened this issue Dec 13, 2022 · 0 comments · May be fixed by #26
Open

Cookie with SameSite=None requires Secure #25

ipoerner opened this issue Dec 13, 2022 · 0 comments · May be fixed by #26

Comments

@ipoerner
Copy link

Mars currently does not set the SameSite attribute for cookies:

mars/session.go

Lines 85 to 93 in 5bad6b4

return &http.Cookie{
Name: CookiePrefix + "_SESSION",
Value: Sign(sessionData) + "-" + sessionData,
Domain: CookieDomain,
Path: "/",
HttpOnly: CookieHttpOnly,
Secure: CookieSecure,
Expires: ts.UTC(),
}

However, Firefox (and possibly also Safari) yield a warning message in that case:

Cookie “MARS_SESSION” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

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

Successfully merging a pull request may close this issue.

1 participant