W3C home > Mailing lists > Public > www-jigsaw@w3.org > March to April 1999

Persistent Cookie - problem

From: Greg Ackerman <Greg.Ackerman@merant.com>
Date: Fri, 26 Mar 1999 13:05:43 -0500 (EST)
Message-ID: <C10DA1F24EB2D211BDDD00104B2449750E8EFC@RALMAIL>
To: "'www-jigsaw@w3.org'" <www-jigsaw@w3.org>
I am using Jigsaw to build a servlet-based online purchasing system demo,
and have run into a problem using Cookies.  The problem is that I have not
been able to make them persistent.  My first servlet creates the Cookie with
name and value, calls setMaxAge(3600000), and adds the cookie to the
Response object.  My second servlet reads all cookies with
request.getCookies(), but is not able to find the cookie.  Let me amend that
- the second servlet WILL be able to find the cookie if the browser has not
been closed, but WILL NOT if the browser has been closed.  Any ideas what I
am doing wrong here?  If you have sample code that would show how I can
create a persistent cookie in one servlet which is added to response, then
access that cookie from another servlet by reading the request, that would
be most helpful.  Thanks from a servlet beginner...

Greg Ackerman
Received on Friday, 26 March 1999 13:12:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:29 GMT