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

curl-and-php

Re: Getting and passing a cookie...

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 17 Feb 2003 06:25:10 +0100 (CET)

On Sun, 16 Feb 2003, Paperstuff.com wrote:

> I need this fixed within 48 hours.

Then consider hiring someone to fix it for you.

> We have a PHP script to upload auctions to eBay. They changed their login
> page and we can't get logged in now. We are able to get the cookie, but
> don't know how to write it to a file on our server.

You don't know how to write what? The cookie? Using COOKIEJAR, you'll get all
known cookies written to the given file when you close the curl "handle".

> Also, how to pass it back.

By loading/setting the cookie before a request, possibly by using COOKIEFILE.

> USERNAME and PASS have been inserted where you need to put a working
> username and password. Registration is free, so it is easiest if you sign
> up for an account if you don't already have one.

[source code cut out]

The source looked fine to me (not being a PHP hacker at all). What is it more
exactly that doesn't work?

What about adding some traces (VERBOSE or similar) to display:

* What your requests look like (do they include the proper cookies?)
* I'd guess you need FOLLOWLOCATION.
* What the response-headers look like.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-02-17