Skip to content

CookieRequestCache ignores user Locale #13792

@ArnaudLec

Description

@ArnaudLec

Describe the bug
When using a CookieRequestCache, the first request after authentication is served using the platform's default Locale instead of the user's.

To Reproduce
See sample app.
Navigate directly to http://localhost:8080/some-home (log in with user:{generated-uuid}), the first request after authentication is served using the platform's default (in my case en-US) instead of fr-FR which my browser's asked.
When refreshing, navigating, etc. after, all requests are served in french, respecting my Accept-Language header.

Expected behavior
The first request after authentication should respect the user's language preference.

Sample
saved-request-locale-bug.zip
I have included 2 HAR files, one using the native CookieRequestCache and one using a fixed CookieRequestCache where the Locale is set in the created SavedRequest.
It seems CookieRequestCache is only missing the line builder.setLocales(Collections.list(request.getLocales())); at line 77 (spring-security 6.1.1).

Metadata

Metadata

Labels

in: webAn issue in web modules (web, webmvc)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions