title: Cookie creation on redirection java spring boot
body: <p>Starting with the description of what is happening.
  Say I have an API <code>www.domain.com/login</code> and once the user login it redirects to <code>www.someOtherDomain.com</code> and while redirecting the response sent to someOtherDomain has a set-cookie header, having a cookie with a domain  (.domain.com). This cookie is for persisting the login session of the user on a domain (www.domain.com). But the cookie is not being set up and hence no login session is being created.</p>
  
  <p>What I want to do:
  I want to set the cookie on the same domain where the login page is hosted (here it would be www.domain.com) and then redirect to the someotherdomain.com. </p>
  
  <p>additionals:
  I am using <code>org.springframework.web.servlet.view.RedirectView</code> for redirection and for setting the cookie I am using <code>HttpServletResponse response</code></p>
  
  <p>How can this be achieved in java spring boot?</p>