The getDomain method of the Cookie class is supposed to return the domain
that this cookie is registered for. Unfortunately the Cookie specification
doesn't supply this data when it returns a cookie, only when one is being
set. So, this call is really only useful when you're getting ready to set a
cookie, not when you receive one.
(*Chris*)
----- Original Message -----
From: "Jeremiah Connelly" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 29, 1999 5:27 AM
Subject: Cookie help
> Arrgh. I cannot figure out why this isn't working correctly!! Every
> time I look up the domain "arnie.eng.mcd.mot.com" it returns "null".
> This makes no sense because the cookie is there and it is the first one
> in the list as well. But it always returns NULL. Any help would be
> great. Thank you very much.
>
> cookies = req.getCookies();
>
> for (int i=0; i<cookies.length; i++)
> {
> Cookie thisCookie = cookies[i];
> System.out.println("Cookie's Name is: " + thisCookie.getName());
>
> System.out.println("Cookies Domain is: " +
> thisCookie.getDomain());
>
> if (thisCookie.getDomain().equals("arnie.eng.mcd.mot.com"))
> {
> do this blah blah blah;
> }
> else
> {
> do this blah blah blah;
> }
> }
>
>
___________________________________________________________________________
> 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
>
___________________________________________________________________________
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