Announcement Announcement Module
Collapse
No announcement yet.
RedirectView with cookie on response Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RedirectView with cookie on response

    I have a question about the return of a RedirectView
    Consider the following example snippet, as part of a controller.
    Code:
    	@Override
    	protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object o, BindException b) throws Exception {
    		Cookie c = new Cookie( "bar" , "foo" );
    		response.addCookie(c);
    		return new ModelAndView ( new RedirectView ( "otherpage.html" ) );
    	}
    What happens to the cookie placed on the response.
    Does the RedirectView offer the cookie to the browser, and then sends a redirect, or is the response ignored.

    Thanks!

  • #2
    I found out that the cookie is stored first, before the redirect

    Comment

    Working...
    X