I am adding cookies using response.addCookie and then redirect using response.sendRedirect to an URL in different domain. Cookie path is already set to "/".
HttpServletResponse response = (HttpServletResponse) Facescontext.getCurrentInstance().getExternalcontext().getResponse(); response.addCookie(cookie); response.sendRedirect("http://different.domain.com/xyz.xhtml");
In debug mode and after inspecting the response objects, found that cookies are lost before calling the "xhtml" page itself.
I'm using Tomcat 7.0.26. JDK 1.7 and JSF 2.0.
Note - This issue is not replicated on WAS server, I'm able to see the redirection happening successfully along with cookies.
Please help, do I need to add or change any of the lib's to make it work on Tomcat Servers?