Andromeda Mobile wrote:
Thanks guys for your help. By moving the jsp include to the head of the document I was able to get the set cookie working so it was to do with the fact that the cookie needed to be sent before any other output was streamed.
Just my didactic streak at play : Think of it this way : A HTTP response looks like this : 200 OK (HTTP status line) header line 1 header line 2 ... more header lines, like "Set-Cookie: .." (one blank line) Content ... On the wire, the 200 OK is the first one to go out, followed by the first header line, etc. Tomcat composes the status line and the header lines, but holds on to them as long as it can, while it is creating the content. As long as it has not yet output the first byte of the content, you can still change the headers. But as soon as Tomcat has to output the first byte of the content, it has to output the status line, and the header lines, and the blank line first, before the first content byte. Thus, as soon as the first content byte goes out, the headers are already out, and it is too late to change them. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org