Expand|Select|Wrap|Line Numbers
- int maxAge = 60*60*24*365; // one year cookie
- Cookie newCookie = new Cookie("thisWebUser", "Brita");
- newCookie.setMaxAge(maxAge);
- newCookie.setDomain(".tolltest.com");
- newCookie.setPath("/");
- response.addCookie(newCookie);
everything is just fine.
The business website uses a VERY large servlet to manage all the pages in the site. I wanted this code on most of the pages, so I added it to a file called "header.jsp" which is in an include folder.
The page url (not accessable from the outside) is something like this
tolltest.com/homesearch/servlet/HomeSearch
Anyway when I add the cookie code (with different values) to in header.jsp file, the cookie won't set. The code for reading cookies works just fine, and I can see the cookie I set with in CookieTest.jsp
Any ideas what could be going wrong, and more importantly how I might be able to get this to work?
Thanks,
Brita