my dog learned polymorphism
The moose likes Servlets and the fly likes kookie.getMAxAge Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "kookie.getMAxAge" Watch "kookie.getMAxAge" New topic


Bruno Korcinski

Joined: Jun 03, 2003
Posts: 16
Hi guys,

I have set kookie.setMaxAge(3600)in servlet SetCookie;

I read back kookies in other servlet ShowCookie...kookie was there but I have expected some int value in seconds kookie.getMaxAge()but I got -1.
Is this value reset to -1 so I canot check how much time for kookie was sets before?


myCookie Name myCookie Value MaxAge
Persistent-Cookie-0 Cookie-Value-P0 null null -1
Persistent-Cookie-1 Cookie-Value-P1 null null -1
Persistent-Cookie-2 Cookie-Value-P2 null null -1

I took out special char...from html and ..ookie =Kookie for posting on this page

Kookie[] cookies = request.getKookies();
Kookie kookie;
for(int i=0; i<kookies.length; i++) {
kookie = kookies[i];
out.println("TR\n" +
" TD" + kookie.getName() + "\n" +
" <D" + kookie.getValue()+ "\n" +
" TD" + kookie.getDomain() + "\n" +
" <D" + kookie.getPath() + "\n" +
" <D" + kookie.getMaxAge());
I agree. Here's the link:
subject: kookie.getMAxAge
It's not a secret anymore!