Log in to the site via cURL I write cookies to a file

curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.ini'); curl_setopt($ch, CURLOPT_COOKIEFILE,'cookie.ini'); 

And perform some actions. What is the best way to check (besides reading cokie.ini and searching for the domain where authorization takes place), are cookies created from the site or not, so that with each action you do not have to go through a new authorization?

    2 answers 2

    In the headlines you can see.

     curl_setopt($ch, CURLOPT_HEADER, 1); 

      No .. When logging in just write in the kurle

      curl_setopt ($ ch, CURLOPT_COOKIEFILE, 'cookie.ini'); and the kurl itself will send the saved cookies along with the request ..