cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: CURL session login problem ... IMPROVED

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Thu, 20 Jul 2006 11:31:15 -0500

Did you try just going to the parent website first, then going to the
login page?? I just tried:

   curl -v http://www.teflasia.com

and among other things there was this header:

   < Set-Cookie: PHPSESSID=4b0d8835c452de375414956f9b827e2c; path=/

That might be enough to start the cookie trail.

i.e.

   curl -b cookiejar -c cookiejar -o /dev/null http://www.teflasia.com
   curl -b cookiejar -c cookiejar -o loginpage.html -d "Femail=....."
http://www.teflasia.com/.....

Ralph Mitchell

On 7/20/06, dara burke <daraburke78_at_yahoo.com> wrote:
> 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