Hi,

I'm writing a servlet that is to redirect the user to a remote website.
This remote website requires me to send three cookies. Unfortunately, I
cannot seem to send a cookie using the response.sendRedirect method. The
following is a test servlet that I wrote to test sending cookies.

HttpSession session = request.getSession(true);
Cookie cookie = new Cookie("name", "Andy");

cookie.setPath("/");
cookie.setDomain(".remoteServer.com/");
response.setContentType("text/html");
response.addCookie(cookie);

response.sendRedirect("http://remoteServerDomain/test.asp";);

I have also tried putting the addCookie() method after the sendRedirect
method as well. No luck though. I would appreciate any help that anyone
could give me.

Thanks,
Andy



Reply via email to