cURL / Mailing Lists / curl-users / Single Mail

curl-users

CURL session login problem ... IMPROVED

From: dara burke <daraburke78_at_yahoo.com>
Date: Thu, 20 Jul 2006 09:03:56 -0700 (PDT)

I'm curl'ing a site, providing my username and password and then storing the cookie in cookie.txt. Some sites seem to have a feature whereby you can't get a valid login session cookie unless you have a normal session cookie already. So that you can't go straight to the login page and login, if you don't have some kinda session cookie for the site already.

If you try to log in without the other cookie, it'll tell you that your login failed and it'll issue you with a session cookie. When you press submit again, with the same details it'll log you in.

Now the bug here is that curl won't seem to provide a login cookie to the server, at the same time as taking a login cookie from the server. So it's not possible to curl these sites ?

curl -d "Femail=my_email&Fpasswd=my_pass&Flogin_x=Log+In" -b cookie.txt -A 'Mozilla/4.05 [en] (X11; U; Linux\ 2.0.32 i586)' -c cookie.txt -e www.teflasia.com/member/member/login.html http://www.teflasia.com/member/login.html

IMPROVED: pls test with my username and password
my_email=daraburke78%40gmail.com and mypass=thahovil ... it's a free site anyway so it doesn't matter ..

It's definitely not just a non-browser issue. If I go straight to the login page with my browser, but without a session cookie, it won't log me in. Then for the second login, if I delete the cookie, it won't log me in either ... this can go on ad infinitum. It's definitely a session cookie thing. The browser seems to be able to provide it, but curl doesn't ..

                 
---------------------------------
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.
Received on 2006-07-20