curl-and-php
Re: Re[2]: Sessions in CURL
Date: Mon, 11 Jun 2001 13:23:09 +0200 (MET DST)
On Mon, 11 Jun 2001, Vladimir wrote:
> How can I store cookies into a file (In binary curl I have to do -D
> somefile.txt) What is the same command in builded into PHP CURL module (I
> see only CURLOPT_COOKIEFILE but it can only pass cookies but not create
> and store cookies)
Now, this is an issue about the PHP-interface functionality. It is a bit out
of the areas I think I master, but I can tell you some basics around this, so
that other might fill in the blanks:
Storing cookies with -D from the command line tool is about saving the
headers. The libcurl interface allows the client to specify a specific
callback and/or userdata for headers, that makes this possible. You need to
consult the PHP-CURL docs in order to find the details around this.
The CURLOPT_COOKIEFILE option will enable the "cookie parser" even if you
specify a non-existant file. libcurl will then record and parse all incoming
cookies and send them back on the following requests (that uses the same
handle) when they match (domain, path etc). You don't have to store them in
files and read them back for this to work.
-- Daniel Stenberg -- curl dude -- http://curl.haxx.se/ _______________________________________________ Curl-and-php mailing list http://curl.haxx.se/Received on 2001-06-11