I'm using the following config:
Two of the filters auto-created by <http> are:Code:<http auto-config="false" use-expressions="true" entry-point-ref="loginUrlAuthenticationEntryPoint"> <session-management invalid-session-url="/login.htm?sessionTimeout=true" /> <intercept-url pattern="/login.htm**" filters="none" /> <intercept-url pattern="/**" access="isAuthenticated()" /> <!-- FORM_LOGIN_FILTER--> <custom-filter position="FORM_LOGIN_FILTER" ref="customUsernamePasswordAuthenticationFilter" /> ...
SessionManagementFilter, which calls ExceptionTranslationFilter.
ExceptionTranslationFilter is the one that populates the requestCache, via:
BUT, this code never gets called when the invalid-session-url is defined, since in that case the SessionManagementFilter performs a redirect BEFORE calling the ExceptionTranslationFilter:Code:protected void sendStartAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, AuthenticationException reason) throws ServletException, IOException { ... requestCache.saveRequest(request, response);
Shouldn't the SessionManagementFilter populate the request cache before calling the redirect?Code:if (invalidSessionUrl != null) { ... redirectStrategy.sendRedirect(request, response, invalidSessionUrl); return; } chain.doFilter(request, response);


