-
Notifications
You must be signed in to change notification settings - Fork 41.1k
CookieSameSiteSupplier influences session cookie #39766
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
Thanks, @cbrachem. From your description it sounds like the problem will be Jetty-specific and that neither Tomcat nor Undertow will behave the same way. To help us to verify if that's the case, could you please provide a minimal sample that reproduces the behaviour you have described? |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
@wilkinsona You are right, the problem is Jetty-specific. I've created a sample application here: https://github.com/cbrachem/samesitecookiedemo Please note that there is a The reason is that |
This works in 3.1.x, it only starts breaking in 3.2.x. |
When upgrading an application from Spring Boot 2.7 to 3.2, we noticed a change in behavior for the session cookie. In 3.2, it uses the SameSite attribute provided by a
CookieSameSiteSupplier
bean. This is not the case in 2.7, where only setting theserver.servlet.session.cookie.same-site
config property influences the session cookie. I think the change was introduced with the upgrade to Jetty 10. Now, creating the session cookie goes through theSuppliedSameSiteCookieHandlerWrapper
.Mitigating the effects of this change is trivial (just adapt the
CookieSameSiteSupplier
bean to exclude the session cookie by name), but I would like to have the documentation match the actual behavior. At the time of writing this, it says:which imho implies that it does not affect the session cookie.
Changing the documentation and maybe adding a note for a breaking change in behavior is probably the easiest fix, and even allows for more flexible configuration as seen here, for example. I haven't looked into the alternative yet, i.e. making the
CookieSameSiteSupplier
not affect the session cookie, but I'm willing to bring a PR either way if this is to be fixed.The text was updated successfully, but these errors were encountered: