curl-and-php
RE: HTTPS and cURL in PHP
Date: Mon, 6 Sep 2004 10:33:34 +1000
Dear Daniel
Thanks for your response.
I tried to get the cookie from a previous page using example
http://curl.haxx.se/libcurl/php/examples/?ex=cookiejar.php
I also tried curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFile")
But the file is empty after running
I have touch cookieFile and chmod 777 cookieFile but nothing changes.
still get the same response
I still get same response
"No Session ID
Site Match Center was unable to save your session ID in a browser
cookie. It needs to be able to do this in order to work properly.
Please check that:
your web browser is configured to accept cookies from this website
you are not using a proxy that automatically rejects cookies
you are not using filtering software that automatically rejects cookies
"
Any suggestions? .. For more information I want to log in to
https://smc2.inktomi.com/
Thanks a lot in advance
frank
-----Original Message-----
From: curl-and-php-bounces_at_cool.haxx.se
[mailto:curl-and-php-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Friday, 3 September 2004 5:32 PM
To: using curl with PHP
Subject: Re: HTTPS and cURL in PHP
On Fri, 3 Sep 2004, Frank wrote:
> I need to login to a https address, start a session and then download
a
> particular file everyday.
>
> My Curl Options look like this
>
> $ch = curl_init();
> curl_setopt ($ch,CURLOPT_URL, $url);
> curl_setopt ($ch,CURLOPT_POST,1);
> curl_setopt ($ch,CURLOPT_POSTFIELDS, $data);
> curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName");
I take it this is the actual login request?
> but I keep getting this error : unable to save your session ID in a
browser
> cookie. It needs to be able to do this in order to work properly.
>From where? Who says this? If the server responds with a message like
that to
this request, then you probably miss something that the server uses to
detect
if you can set a cookie. That is most likely a cookie from a previous
page.
> Do I need to send any headers?
We can't tell, but the server somehow determines this and you need to
figure
out how and take precautions.
> The cookie file can be just any file or must be a particular one?
The received cookies will be written to the given file. It can be
anyone.
You don't even have to write them to a file if you don't want to (just
activate the cookie parser), as the cookies are kept internally in the
handle
data so if you just re-use the handle it'll use the cookies it knows of.
-- Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se Dedicated custom curl help for hire: http://haxx.se/curl.htmlReceived on 2004-09-06