curl-and-php
Re: Object Moved Error & Tricking the Server
Date: Sat, 11 Dec 2004 20:43:32 -0500 (EST)
As Daniel Stenberg so eloquently wrote:
> It sounds as if you're not providing the proper cookie.
>
>> curl_setopt($ch,
>> CURLOPT_COOKIE,"ASPSESSIONIDQQQBBADB=CKCDKPDBCIALIIIEGCDJIKLG");
>
> I doubt this works. These kinds of session cookies are usually generated
> with
> a session-specific value, so when you just repeat an old value you once
> had,
> it won't have the desired effect. The server is bound to consider it
> illegal.
>
> You probably first need to fetch the page that sets this cookie, then move
> on
> you do this operation and use the cookie you just got.
Ah, thanks so much. I took the cookie from the header using the cookie
example on your site, and everything worked from there.
>
>> curl_setopt($ch,CURLOPT_FOLLOWLOCATION,0);
>
> ... and you probably still want to follow Location: headers, because it is
> very likely that you'll just get a different one when you do everything
> right.
It only throws a redirect if there is an error, but just to be safe, I did
change it. Thanks again for your help.
Stephen Swift
sadba_at_geneseo.edu
Received on 2004-12-12