2. Перехожу по пдресу https://passport.yandex.ru/auth
3. в консоле прописываю $.post("https://passport.yandex.ru/registration-validations/suggest", 'firstname=asd&lastname=dads&track_id=1&language=ru');
Запрос выполняется и возвращает данные...
Пытаюсь сделать тоже самое через cURL, но почему-то сервер возвращает ошибку
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://passport.yandex.ru/auth');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($ch);
curl_setopt($ch, CURLOPT_REFERER, 'https://passport.yandex.ru/auth');
curl_setopt($ch, CURLOPT_URL, 'https://passport.yandex.ru/registration-validations/suggest');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'firstname=asd&lastname=dads&track_id=1&language=ru');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$html = curl_exec($ch);
curl_close($ch);
print_r($html);
В ответ сервер возвращает Forbidden(т.е. 403)
В чем может быть ошибка?