cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Login and uploading in one session

From: Matti Leino <mle_at_demoefekti.net>
Date: Thu, 31 Mar 2005 01:57:54 +0300

Daniel Stenberg wrote:
> On Thu, 31 Mar 2005, Matti Leino wrote:
>
>> So I have to grab those random values, which are generated when
>> accessing the page and post those values. And of course, I have to do
>> two posts in one session.
>>
>> Is this possible? I have tried to play with options given in man-page,
>> with no luck. Or am I missing something very simple?
>
>
> I think you're missing the fact that you don't need (or want) to do this
> with one single command line.
>
> Using your favourite scripting language, you first fetch the login page,
> extract the hidden fields and then you POST the login form using that
> data... Then you extract the info in the next page and continue.
>
> Remember to read/store the cookies between the curl invokes.
>

Thanks you from your answer, and yes, you're right, I could do it that
way. But I was thinking, since for security reasons, session_id must be
always same, I mean that when you go to login page, you start new
session and post that session id in hidden form field. But if I close
this first connection and open new connection, old session is destroyed
and session_id has changed, and I have to login again. So that's the
reason why I was thinking a way to do this.

I'll still have to think this a little bit more... :)

-- 
Matti Leino
mle at demoefekti dot net
Received on 2005-03-31