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

Support SameSite Cookie #1005

Closed
rwinch opened this issue Feb 26, 2018 · 4 comments
Closed

Support SameSite Cookie #1005

rwinch opened this issue Feb 26, 2018 · 4 comments
Assignees
Labels
in: core type: enhancement A general enhancement
Milestone

Comments

@rwinch
Copy link
Member

rwinch commented Feb 26, 2018

We should add support for using SameSite Cookie for session cookie to mitigate CSRF attacks. See https://scotthelme.co.uk/csrf-is-dead/

@rwinch rwinch added this to the 2.1.0.M1 milestone Feb 26, 2018
@richard1122
Copy link

richard1122 commented Apr 23, 2018

Hi, are there any plans to support SameSite cookie in spring-session 1.x.x ?

@rwinch
Copy link
Member Author

rwinch commented Jul 15, 2018

@richard1122 If someone sent a PR that was passive with tests we would consider it.

@jmpavlec
Copy link

jmpavlec commented Sep 17, 2019

Was this included in a migration guide anywhere or mentioned in the docs? I was not able to find any references about it. Making SameSite=lax for the SESSION cookie as the new default for Spring Session has some implications depending on the browser used. It potentially breaks some cross-domain SSO/SLO functionality that was dependent on the SESSION cookie. Safari also has a bug related to overriding it to be SameSite=none https://bugs.webkit.org/show_bug.cgi?id=198181

More clearly outlined in https://web.dev/samesite-cookies-explained/

Edit: Found it mentioned in release notes: https://spring.io/blog/2018/10/31/spring-session-bean-ga-released

@vpavic
Copy link
Contributor

vpavic commented Sep 27, 2019

You're right @jmpavlec, we should provide some info about SameSite support in our reference manual. I've opened #1517 to take care of that.

If you're facing any issues due to presence of SameSite directive in our session cookie, you could disable it by providing a null value to DefaultCookieSerializer#setSameSite. Note that this requires overriding the default cookie serializer by providing your own DefaultCookieSerializer @Bean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants