Cookie c = new Cookie("testCookie", "book");
c.setPath("/pp/ll");
c.setDomain("www.test.com");
c.setMaxAge(100000);
c.setComment("comment!");
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
test: 6
Set-Cookie: testCookie=book; Domain=www.test.com; Expires=Tue, 17-May-2011 11:41:02 GMT; Path=/pp/ll
Content-Length: 0
Date: Mon, 16 May 2011 07:54:22 GMT
/
Cookie c = new Cookie("testCookie", "book");
c.setPath("/pp/ll");
c.setMaxAge(0);
c.setComment("comment!");
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
test: 6
Set-Cookie: testCookie=book; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/pp/ll
Content-Length: 0
Date: Mon, 16 May 2011 08:00:32 GMT
/
Cookie c = new Cookie("testCookie", "book");
c.setPath("/pp/ll");
c.setMaxAge(-1);
c.setComment("comment!");
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
test: 6
Set-Cookie: testCookie=book; Path=/pp/ll
Content-Length: 0
Date: Mon, 16 May 2011 08:03:10 GMT