Secure flag of CookieCsrfTokenRepository cookie #5414
Labels
in: web
An issue in web modules (web, webmvc)
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
Summary
Can we please allow for configuring the desired value of the "secure" flag for the XSRF-TOKEN cookie created by CookieCsrfTokenRepository?
Actual Behavior
The flag is always set based on the "isSecure" flag on the Http request:
cookie.setSecure(request.isSecure());
Expected Behavior
While using the request's "isSecure" flag is a reasonable default, when webapps sit behind firewalls, sometimes the firewall does the SSL, and the traffic between the firewall and the app is plain HTTP (not HTTPS). In this case the "isSecure" flag on the request is always false, but we still want th XSRF-TOKEN cookie to be secure (the firewall forwards all cookies to the app, and the browser sends the secure cookie to the firewall).
It would be nice if we could configure the desired value for the secure flag of the cookie, just like we can configure the value for the httpOnly flag of the cookie.
Configuration
Version
I'm currently on 4.2.6.RELEASE
Sample
The text was updated successfully, but these errors were encountered: