Hi Andreas
I believe that the key is in (quoting):
"The syntax for the header is:
cookie = "Cookie:" cookie-version
1*((";" | ",") cookie-value)
... "
That means when you want to send multiple cookies (cookie1 has name1
and value1, cookie2 has name2 and value2)
you send:
"Cookie: name1=value1; name2=value2"
In your case you send two different headers:
"Cookie: name1=value1"
"Cookie: name2=value2"
Maybe some servers may accept this, but the one I am working with
chokes on it and skips all the "Cooke: " statements following the
first one.
If you take a look at the "Live HTTP headers" with FireFox, you'll see
requests with cookies follow the "all-cookies-in-one-line" rule.
Regards,
Andrei
On Wed, Aug 4, 2010 at 1:15 PM, Andreas Raab <[email protected]> wrote:
> On 8/4/2010 9:57 AM, Mariano Martinez Peck wrote:
>>
>> Hi Adrei, excellent :)
>>
>> BTW, for HTTP Client you should cc Andreas Raab or squeak mailing
>> list....
>
> Squeak-dev please
> (http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/squeak-dev).
>
>> On Wed, Aug 4, 2010 at 6:08 PM, Andrei Stebakov <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> I also found that cookies were not correctly sent.
>> Every cookie was sent with its own "Cookie: " header which is not
>> correct.
>
> I'm curious, why do you think that's incorrect? My understanding is that RFC
> 2616 explicitly allows that:
>
> "Multiple message-header fields with the same field-name MAY be
> present in a message if and only if the entire field-value for that header
> field is defined as a comma-separated list [i.e., #(values)]. It MUST be
> possible to combine the multiple header fields into one 'field-name:
> field-value' pair, without changing the semantics of the message, by
> appending each subsequent field-value to the first, each separated by a
> comma."
>
> And the condition appears to be satisfied in RFC 2109 regarding the Cookie
> header:
>
> "The syntax for the header is:
>
> cookie = "Cookie:" cookie-version
> 1*((";" | ",") cookie-value)
> ... "
>
>
>> Also cookie collection is too restrictive to the domain. Let's say
>> your request goes to www.domain.com <http://www.domain.com> and in
>> the cookies it'll have
>> domain.com <http://domain.com>.
>> Those cookies won't be collected since the current algorithm requires
>> it to match from the start of the string (probably should only match
>> the end of the string).
>
> Yeah, that's a silly bug. Thanks for reporting.
>
> Cheers,
> - Andreas
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project