cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Cookie problem with POST/HTTPS connection

From: Ralph Mitchell <rmitchell_at_eds.com>
Date: Thu, 11 Mar 2004 06:24:09 -0600

OK, let me restate what I think you're saying, to make sure I'm
understanding you.

You're using a browser on your local machine, to hit a php/curl script
on your own server. The script runs out and steals a page from worldpay
and hands it back to your browser. You then click on a link on the
returned page which takes you direct to worldpay and worldpay doesn't
like it. Is that about right?

If so, is your script retrieving cookies from worldpay and (here's the
important part) handing them to your browser? If not, your browser will
never have the same session info that your scripts received when it
first poked worldpay. You may need to scrape the cookies out of the
worldpay headers (or save to a cookiejar file and then fopen/fread them)
and fix them up so that your browser thinks they came from worldpay.

Also, in that <base href..> are you filling in the effective url of the
page, or just the worldpay server name? i.e. does it have directory
components?

Ralph

Paul Forsyth wrote:

>Yes, for the original curl call, and this works.
>
>the problem i have is that i've left the php/curl environment, and now
>rely on the browser for the calls. the page, produced from curl, is on
>my local server. when i click another link (another form submission to
>worldpay) it fails. probably because it expects me to be coming from
>worldpay. i can maybe use curl again but because worldpay use lots of
>pages with form submits i might have to accept defeat and use a http
>form to start the process off. i had hoped that once i was through the
>front door, with curl, it would be ok, but.... :(
>
>paul
>
>On Thu, 2004-03-11 at 10:47, Ralph Mitchell wrote:
>
>
>>Paul Forsyth wrote:
>>
>>
>>
>>>After I put in a <base href=""> I got the screen i wanted but i think
>>>i've hit a dead end. Further progression seems to rely on on the
>>>referrer being correct. As the user is still at my server, and not at
>>>worldpay, the referrer will be incorrect. Doh!
>>>
>>>
>>>
>>Did you try faking the referrer?
>>
>> curl ...... -H "Referrer: xxxx" .....
>>
>>or something a lot like that...
>>
>>Ralph
>>
>>
>>
>>
Received on 2004-03-11