wood burning stoves 2.0*
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
Author

kookie.getMAxAge

Bruno Korcinski
Greenhorn

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?

Thanks
Igor

****************************************************
ShowCookie
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



P.s
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());
}
out.println("TABLE/BODY/HTML");
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: kookie.getMAxAge
 
Similar Threads
Persistent Cookies in Servlets
Create Cookie and display the Cookie values.
need help for cookies problem
Re: Cookie problem
Why Cookie.getDomain() returns null?