PHP cURL to login to facebook PHP cURL to login to facebook curl curl

PHP cURL to login to facebook


This may help:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);

Check this answer:

Post to a Facebook user's wall with cURL PHP


I had the same problem and I fixed it by adding the following:

curl_setopt($s, CURLOPT_COOKIESESSION, false);


This must be used on curl cookie :

curl_setopt($ch, CURLOPT_COOKIEFILE, getcwd () . '/mirazmac_cookie.txt' );curl_setopt($ch, CURLOPT_COOKIEJAR, getcwd () . '/mirazmac_cookie.txt' );