I am facing a slightly weird problem. I am setting a cookie in my Java Servlet, and accessing it later. This works when I am accessing my webapp from
tempCookie = new Cookie("CN.checkCookie", "try this!!!");
tempCookie.setMaxAge(60 * 60 * 24 * 365);
Sounds like privacy configuration in your browser. Check it. As far as I remember your can configure privacy in browsers per URL. This may explain this strange behavior.
Additionally I'd recommend you to call setDomain() and setPath() explicitly.