cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: cURL - Sessions?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 20 Aug 2008 14:22:16 -0700

On Wed, Aug 20, 2008 at 10:58:12PM +0200, Kabel wrote:
> Well, I managed to establish the connection to the site, store the cookies and
> transmit the data to the next page using post.
> I only have a lot of problems with the session, in fact, I use twice a curl
> command, so that the session id isn't preserved and I get a bad answer from
> the site.
>
> Here my (little bit modified commands):
>
> #curl --cookie-jar cookies.txt --user-agent
> Mozilla/4.0 --data "destination=more-info.php&credential_0=tweety&credential_1=mySecretPass"
> http://url.com/login -v -k -D /home/tweety/Desktop/header.txt
>
> and just after (to procede to the next page):
> #curl -c cookies.txt --user-agent Mozilla/4.0 http://url.com/page2 -v

This command uses -c which writes any new cookies to the file. You need to
add -b to read the cookies written by the first command.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html

  • application/pgp-signature attachment: stored
Received on 2008-08-20