curl-users
CURL and cookies
Date: Mon, 10 Apr 2006 10:31:01 +0100 (BST)
After a couple of hours of searching on the net, I
feel a bit lost and am wondering whether anybody could
help me out with a quick sample script. I have the
feeling this is all pretty simple, but I'm quite new
to CURL and a bit overwhelmed by the options. ;-)
Here's what I'm trying to do - I'm sure hundreds of
other users must have tried the same:
I am using Perl and WWW::Curl::Easy to download a set
of web pages and I would like to use the cookies that
are set by the remote server. When I get the first web
page, the server sends something like this:
HTTP/1.0 200 OK
Date: Mon, 10 Apr 2006 09:11:09 GMT
Server: Apache
Set-Cookie: PQIL=1234; Path=/
Set-Cookie: UID=abcdefg; Path=/
Set-Cookie:
JSESSIONID=235C9BE3785B47EEBC24A49B4ADEA610; Path=/
Content-Type: text/html;charset=ISO-8859-1
X-Cache: MISS from proxy.xyz.com
X-Cache-Lookup: MISS from proxy.xyz.com:3128
Proxy-Connection: close
How do I store a cookie and how do I re-use it from
within the Perl script? This is probably very easy -
but what I would really need is a short pice of
*sample code* to get this done (or a link to some
sample code). Imitating others seems to be the easiest
way for me to learn. ;-)
My attempts so far have not been successful as the
next time my script accesses a page from the same
server, the cookie is set again...
Any help would be greatly appreciated!
Thanks!
sebhoff2002
___________________________________________________________
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/
Received on 2006-04-10