cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: COOKIE question

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sat, 4 Sep 2004 09:08:15 +0200 (CEST)

On Sat, 4 Sep 2004, Dimitris Tripakis wrote:

> You provide a "save some data to a file" function, but not a "give me those
> data in memory" function.

The "data" in question is already stored in memory. The cookies are kept
associated with the easy handle and if you re-use the same handle, it'll use
the proper cookies.

> Name one API that does the same in any context whatsoever.

I could, but since we're talking curl here I won't.

We've discussed improving the cookie handling and adding a special cookie
interface to libcurl a long time, and if you dig in the libcurl mailing list
archives you'll find discussions about it. So far, not a single person has
volounteered to join in to write it and I suspect this is more or less because
the majority of all users of libcurl find the current support good enough for
them.

> After all if your work was not good/useful I wouldnt be here, right ? You
> want only praises and not comments ?

My work is curl and libcurl. I didn't write PHP/CURL. Yes I want comments and
not just "praise", but getting a grumpy "why don't your program do XXXX" is
not a very friendly way to bring critique. IMHO.

> 4. By the way another comment is that there is no way for the progammer to
> see/set the header that he is actually sending, or at least its not obvious
> how to do this.

Yes, and I have mentioned this dozens of times (mostly on this list). That is
perhaps the single biggest flaw I'm aware of in the PHP/CURL interface. Both
curl the command line tool and libcurl the library offer perfect means to do
this.

> I mean I had a manual with the header I wanted to send, and was trying for 5
> hours to figure out how to construct this header with CURLOPT combinations.
> Also had to write a java servlet just to print the header, so I can see what
> Im sending.

... which is why I repeatedly and often recommend everyone to first work out
the operation with the command line tool and then convert that to a PHP
program. Simply because that offers a better interface to versatile info about
the requests.

Again: I did not write the PHP/CURL layer. I author and maintain libcurl and
curl the command line tool. They are not all providing the exact same set of
features.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-09-04