You are going wrong by trying to set a domain that is illegal.  Domains do
not start with a "." and setDomain() ignores it.  I assume you are trying to
check the domain of the returned cookie with the starting "."; of course it
will return null.

Mark

-----Original Message-----
From: cbarnes [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 3:35 AM

Some might say this question is a bit off topic - but the Cookie class is
part of the servlet package so I thought I would risk it.

I am using javax.servlet.http.Cookie to create a cookie, and I want to be
able to set the domain on this cookie.
I am calling Cookie.setDomain(".whatever.com"); (note that the domain starts
with a ".")
However, when the browser (IE) asks if the cookie can be set it shows a
domain of "whatever.com" in the dialog box.
If I retrieve the cookie and check the domain it is null.
I am assuming this is because the domain wasn't set with the first ".", but
if I call Cookie.setDomain with a value that starts with "." it strips it
off.

Can anyone suggest where I am going wrong?
Any help or suggestions will be very much appreciated,

Catharine

___________________________________________________________________________
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

Reply via email to