I have a servlet filter set up to handle various ways of entering my website. One goal of the filter is to set a cookie on entry. The below code works perfectly in Chrome, Safari and Firefox but IE doesn't seem to like it. Due to some constraints I am not able to set the cookie with JavaScript.
Cookie cookie = new Cookie(COOKIE_NAME, COOKIE_VALUE);
cookie.setPath("/"); //Note: I've tried removing this.
cookie.setDomain(SITE_DOMAIN); //Note: I've tried removing this.
response.addCookie(cookie);
I've tried different combinations of max age and expiration date, but nothing seems to work. I've stepped through on a debugger and I'm sure the code is being executed.
Also, for the record I'm using Tomcat 6. Cookie name and value are both strings of around 10 chars length.