Describe the bug I am using CookieRequestCache . However, as SendRedirect proceeds first, cookie settings are not included.

To Reproduce

Expected behavior 

Sample

https://github.com/spring-projects/spring-security/blob/bf138c5154e87b55ab6f1c8940116351d6e1aedc/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/web/OAuth2AuthorizationRequestRedirectFilter.java#L189-L190

Comment From: jzheaux

@o1i0, thanks for the report. In your PR, will you please include a unit test that behaves the way you are expecting? It should fail without your change and pass with it.

Including a unit test will give me a better idea of your use case to see if there is a better way to address it.

Comment From: o1i0

@jzheaux, Thanks for the quick check.

Added a test case where the response should be requestCache.saveRequest before isCommitted. https://github.com/spring-projects/spring-security/pull/11603/files#diff-09f439ada4e90ffa29137b421089e9fcf474193dcef6fb5ee15e78e5c2ed2e20R195-R196

Please check.