Hi there,
I have a problem with storing my Cookies. I made a servlet in which I
store a Cookie (in the doGet()-method) to detect whether a user has
already visited my webpage.
I used the following code:
Cookie c = new Cookie("sessionID", generateSessionID());
c.setMaxAge(60*60*24*365);
response.addCookie(c);
To test the Cookie I surfed to another website and then returned to my
servlet.
When I tried to retrieve the Cookie (with
HttpServletRequest.getCookies()) no Cookies were returned. The same
thing happened when I closed my browser, opened it again and returned
to my servlet. My browser is set to accept all posiible Cookies. Does
anybody know a solution to my problem?
Thanks in advance!