Problem with storing Cookies
From: Blossom (BlossomBlossom70_at_hotmail.com)
Date: 04/29/04
- Next message: Julie: "Re: Cracking DES with C++ is faster than Java?"
- Previous message: Roedy Green: "Re: Java problems"
- Next in thread: KrOoSh: "Re: Problem with storing Cookies"
- Reply: KrOoSh: "Re: Problem with storing Cookies"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Apr 2004 04:18:53 -0700
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!
- Next message: Julie: "Re: Cracking DES with C++ is faster than Java?"
- Previous message: Roedy Green: "Re: Java problems"
- Next in thread: KrOoSh: "Re: Problem with storing Cookies"
- Reply: KrOoSh: "Re: Problem with storing Cookies"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|