The "Set-Cookie" header is only valid on HTTP response messages. HTTP
request use "Cookie" header instead. Therefor, you should be doing
request.getHeader("Cookie").
Walter Lara

-----Original Message-----
From: Naveen Chandra [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 07, 2000 5:55 PM
To: [EMAIL PROTECTED]
Subject: Re: domain value of the Cookies in Servlets


Hi Nic Ferrier,

Thanks for the reply, but the request.getHeader("Set-Cookie")
always gives me a null value in my servlet code.

Is it really a bug OR ..... ???

Thanks,
Naveen.

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Nic
Ferrier
Sent: Thursday, September 07, 2000 6:13 PM
To: [EMAIL PROTECTED]
Subject: Re: domain value of the Cookies in Servlets


>>> Naveen Chandra <[EMAIL PROTECTED]> 08-Sep-00 12:33:35 AM >>>

>I could set the domain explicitly and add the cookie
>to my response Object but when I retrive the domain
>using getDomain() method of Cookie object using
>getCookies() method with request object I always get
>null value.

Hmmm... looks like it *might* be a bug.

(this shows how often people use cookies for anything other than
sessions - I have *never* heard of this before!)

When you first create the cookie can you get the domain then?

It could be that the browser isn't sending the domain part of the
cookie to the servlet engine. You could check that by looking at the
request as it comes (with a packet sniffer) in or by retrieving the
header like so:

  public void doGet(....
  {
     String cookies=request.getHeader("Set-Cookie");
     System.out.println(cookies);
   }

It should be very clear if the domain is being transmitted to the
server.


Nic Ferrier

___________________________________________________________________________
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

___________________________________________________________________________
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