David Allen wrote:
>
> Here is what I have come up with:
>
>           //dump out any cookies
>           Cookie[] cookie=req.getCookies();
>           if(cookie!=null){
>                for (int i=0;i<cookie.length;i++)
>                {
>                     response+="<p>Cookie Name: "+cookie[i].getName();
>                     response+="<br>Value: "+cookie[i].getValue();
>                     response+="<br>Comment: "+cookie[i].getComment();
>                     response+="<br>Domain: "+cookie[i].getDomain();
>                     response+="<br>Max Age: "+cookie[i].getMaxAge();
>                     response+="<br>Prefix: "+cookie[i].getPath();
>                     response+="<br>Secure: "+cookie[i].getSecure();
>
>                     response+="<br>Version: "+cookie[i].getVersion();
>                }
>           }
>
> Any suggestions?

I believe you'll find most of the getXxx() methods of Cookie don't
return anything interesting when the cookie is retrieved from the
client.  This is because the client doesn't send things like max age
to the server.  (Why bother, afterall?)  Methods other than getName(),
getValue(), and getVersion() are only useful to query a cookie before
it's sent.

-jh-

--
Jason Hunter
[EMAIL PROTECTED]
Book:    http://www.servlets.com/book
Article: http://www.javaworld.com/jw-12-1998/jw-12-servletapi.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to