response.SendRedirect() resets/destroys Cookies that were set by response.addCookie() Acording to the Java Servlet 2.3 Specification, Page 40, end of the page. "TBD make it clearer that these mechanisms should not destroy existring header information like Cookies."
A simple test in Tomcat 3.2.3 and Tomcat 3.3 shows that response.SendRedirect() does not clear a Cookie that has been set. Marking as fixed.
I think the combination of includes and redirects does the trick. I'm certainly seeing it in effect in my app. Instead of performing a "simple test", try my scenerio: a main index looks for a cookie. If it finds none, it sendRedirects to a page that adds a cookie and then sendRedirects back to the index, with an added param for "triedcookie". If it still can't find a cookie, but the "triedcookie" param was present, it figures their browser is rejecting cookies and goes on with its work, which in this case uses some includes to build out the HTML. Keep up the good work.
*** This bug has been marked as a duplicate of 248 ***