On the site, which I log in using curl, there is a limit on the number of authorizations per day (10 times). I’m logging in normally, with saving cookies and a page opens to me, which is visible only to authorized users.
The problem is that if you just send cookies, then the form is displayed that requires login. And this is already an unwanted waste of authorization attempts for the day.
So I do:
$curl = curl_init(); curl_setopt($curl, CURLOPT_COOKIESESSION, true); curl_setopt($curl, CURLOPT_COOKIEFILE, $cookie_file); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3'); curl_setopt($curl, CURLOPT_URL, 'http://turboliker.ru/index.php?page=cupon&tab=activate'); $html = curl_exec($curl); // должна появиться страница для авторизированного пользователя echo $html; curl_close($curl); How to enter this page with my own cookies? Or is the problem not in them?