cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Cookie problem with POST/HTTPS connection

From: Georg Horn <horn_at_koblenz-net.de>
Date: Wed, 10 Mar 2004 16:45:34 +0100

On Wed, Mar 10, 2004 at 03:23:17PM +0000, Paul Forsyth wrote:
> I thought the cookie would be used too, but it seems to be replaced on
> each http call to the server.

If you dopn't send back the cookie, the server will create a new session every
time, and so the session-id that's stored in the cookie changes every time.

> Take a look at the url for Worldpay:
>
> https://select.worldpay.com/wcc/purchase
>
> When you first load it a cookie is set. The error you see is expected
> because normally POST information is sent.

No, i think the error is displayed because no session information
(that should normally be stored in a cookie) is available. I think
you cannot directly post data to that url, but have too log in before.

> If curl isn't able to move the user to the POST location, like a browser
> does, is there a way to mimick this? How does a browser do this?

You just have to make all requests that the browser would do. Call the
loginpage, remember cookies set, Post Loginid and Password to the url given in
the <form>-tag within the loginpage (and sending the cookies remembered before
with that request!) and so on...

Bye,
Georg
Received on 2004-03-10