commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Rogers" <sc...@scottrogers.org>
Subject Re: [httpclient] Constructing Cookies with null domains (again)
Date Wed, 06 Mar 2002 20:49:08 GMT
This is a 'Cookie Dump' of a servlet running on WebLogic 6.1.

Does this mean the cookie domain is null?

Here is the code that generated it..

    public static String dumpCookies( HttpServletRequest request)
    {
        StringBuffer sb = new StringBuffer();

        sb.append("\n########Cookies in Reques########################");
        Cookie[] cookies = request.getCookies();

        for( int i = 0; i < cookies.length; i++ )
        {
            sb.append("\nName: " + cookies[i].getName() );
            sb.append("\nValue: " + cookies[i].getValue() );
            sb.append("\nDomain: " + cookies[i].getDomain() );
            sb.append("\nPath: " + cookies[i].getPath() );
            sb.append("\nComment: " + cookies[i].getComment() );
        }

        sb.append("\n########End of Cookies in Reques#################\n");
        return sb.toString();
    }

----- Original Message -----
From: "Marc Saegesser" <Marc.Saegesser@apropos.com>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Wednesday, March 06, 2002 2:22 PM
Subject: RE: [httpclient] Constructing Cookies with null domains (again)


> What I meant was that a cookie always has a domain value, it is either
> specified explicitly by a domain attribute in the set-cookie header or
> implicitly as the hostname that it came from.
>
> A cookie without a domain is a pretty useless thing; it will *never* be
sent
> to anyone.  All of the cookie specs are quite specific about what cookies
a
> client is allowed to send to a server and they all require a domain match.
> No domain --> no match --> never sent.  Any other behaviour would be a
> serious bug.
>



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message