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


Re: curl, php, and cookies

From: Murias O'Ceallagh <>
Date: Fri, 23 Dec 2011 11:12:23 -0800

I thank you for this insight.

I have spent the better part of about a week and a half studying cURL, and various tutorials, seem though to then having an understanding issue with cookies and cURL. *grumble*

vBulletin has a convoluted login process, to a degree that any remote login script really needs to include the creation of most of the cookies. Specifically the ones that never get altered while staying logged into the site. These cookies then never get set in the return headers from vBulletin.

Now we enter the realm where I am completely fuzzy with cUrl; It is my understanding that cURL only writes cookies to the cookie file from the headers of the returned headers. How does one then get cookies into the cookie file when the local script is setting the cookies? The other thing I have noticed is that occasionally cURL seems to want to delete cookies from the cookie file if they were not set in the headers, keeping only those that were set. How then to keep those cookies in the cookie file?

Hoping now to start shedding light on my confusion of curl and cookies.

Thank you for this discussion.
May this season be bright for all. ;^)


On Dec 22, 2011, at 6:00 PM, David Colter wrote:

> Murias,
>> How can I get those other cookies into the cookie txt file? Have I missed something in my learning and understanding of curl?
> My understanding of curl in this context is to let curl do the logging in. It will manage the cookies for the connection adding and updating them as they are received.
> When I want a page(s) behind a login, I use curl from the start down to final content. This might mean several curl_exec ( $ch ) statements along the way.
> David
> _______________________________________________

Received on 2011-12-23