I use Spring Security 3.2.1 to secure a Spring MVC application deployed to Tomcat.
When a web session expires, Spring Security automatically redirects the user to the login page. However, some of my AJAX requests use PUT
, POST
and DELETE
methods. When one of those requests gets redirected, FireFox shows this dialogue (other browsers behave differently):
This is normal behaviour for a redirect with 302 status code according to the HTTP/1.1 specification which says:
If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user...
I would like to rid of the dialogue. I think, the dialogue would not appear if Spring Security used a response with 303 status code (not 302). How can I change the status code to 303?