cURL / Mailing Lists / curl-users / Single Mail

curl-users

Cookie paths when the query includes /

From: John P. McCaskey <mailbox_at_johnmccaskey.com>
Date: Sun, 20 Sep 2009 14:50:16 -0700

A web site I'm querying with CURL expects a URL in which there are unencoded
forward slashes in the query string. I thought that was illegal and all
reserved characters needed to be URL-encoded, but I guess I was wrong. When
I URL-encode, the server script does not behave as desired. OK, so I'll uses
slashes instead of %2F.

 

But then cookies misbehave in CURL.

 

The Set-Cookie header does not include a path, so the default must be used.
My browser takes the path up to the last / before the ?. CURL, however, uses
the path up to the last / of the query string. So the wrong path gets
recorded in the cookies file and CURL fails to return a cookie the server is
expecting.

 

Is there a way for me to tell CURL to parse that path only up to, and not
including, the query string?

 

Thanks.

 

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-09-20