-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Same Site Cookie Attribute Feature Request #4341
Comments
👍 |
This is a great idea. |
I think this would be a really nice feature for spring security to offer but it's been over a year since I asked and hasn't had any traction. I guess either it's not seen as useful, is being ignored due to lack of cross browser support support or due to it not being part of the non draft spec, or has some deep implementation issues such the underlying servlet API not being compatible. I don't think this is actually part of the official spec yet for state management (https://tools.ietf.org/html/rfc6265) but it does have support in chrome and firefox (https://caniuse.com/#search=same-site). I guess one could achieve this by manually calling I guess due to lack of support in IE, Edge or some other browsers with some market share it'd be potentially dangerous to rely on this as the only level of CSRF protection. Personally I'm still for this feature request, but perhaps those with more knowledge on the subject could weigh in to give opinions on this. |
The problem is that session and the respective Cookie is created by the Servlet Container without any control given to Spring Security. If you have a way we can implement this in a servlet container independent way, please let us know. Using addHeader is not guaranteed to work because the Servlet container manages the creation of the Session and Cookie. We do have a ticket logged for Spring Session to support it which seems more feasible. See spring-projects/spring-session#1005 |
Closing as this is implemented in Spring Session which does have control over the cookie creation |
Could you possibly give us a pointer where to find this in Spring Session? |
I found this in See my StackOverflow answer: |
Summary
It would be nice if Spring Security would allow a developer an easy way to set authentication cookies to have the "same-site" attribute.
Although not supported in all browsers it is supported in Chrome, Opera and Android browsers:
It'd be very nice if I could enable this with the YAML or properties files in a similar way to HTTP only or secure attribute for sessions:
Perhaps like:
The text was updated successfully, but these errors were encountered: