cURL / Mailing Lists / curl-users / Single Mail

curl-users

cURL - Sessions?

From: Kabel <the.real.kabel_at_gmail.com>
Date: Wed, 20 Aug 2008 22:58:12 +0200

Hello,

I'm new to this list, and also new to cURL.
I want to use cURL, from commandline, to login to a site and then to fill out
a form.

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

Well, I think the problem is that I do 2 connections, so my question is to
know if it is possible to do what I want to do with curl, and if yes, how to
connect this 2 commands to one.

I would be very pleased to get some help, because I didn't managed to make
this work, neither with the man page nor with a lot of web searching.

Thanks,

Laurent

-------------------------------------------------------------------
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

Received on 2008-08-20