-
Notifications
You must be signed in to change notification settings - Fork 6k
CookieCsrfTokenRepository should use the SameSite attribute #7990
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
Comments
At this time, you can use Spring Session to set the SameSite attribute on the session cookie. More information on that can be found in the Spring Session documentation. |
hi @eleftherias , we are indeed using a custom cookieSerializer to set the SameSite attribute for session cookies, but that does not make it possible to set the attribute for the XSRF-TOKEN cookie. |
Yes, that's exactly the feature we'd like to see added. Shall I close this issue then? |
@ddevrien Yes, please feel free to close this issue. |
Should this ticket be reopened? Since @rwinch closed #7537 because that was more about replacing CSRF with SameSite, which was a "Won't Do". But I think many people actually want (or need) this ticket. The only reason this ticket was closed was because it seemed to be a duplicate of #7537? Which it isn't. Edit: #11913 is the more recent version. |
Chrome 80 changed the way it handles cookies that do not set a SameSite attribute. More information: https://blog.chromium.org/2019/10/developers-get-ready-for-new.html . While this change does not break anything, it does generate warnings in the developer console because the SameSite attribute is missing.
It is currently not possible to specify a SameSite value on the
CookieCsrfTokenRepository
. The underlying problem is that the Cookie class in the Java Servlets API does not support the SameSite attribute. Should we check for an alternative? Or wait until the Servlets API adds support for SameSite?The text was updated successfully, but these errors were encountered: