PHP CURL seems to be ignoring cookie jar/file

后端 未结 1 640
梦谈多话
梦谈多话 2021-01-12 20:28

I\'m using this....

    function cURL($url, $header=NULL, $p=NULL)
    {

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_HEADER, true);
                


        
相关标签:
1条回答
  • 2021-01-12 21:21

    The curl constants are split into

    • CURL_COOKIEFILE as the cookies.txt source which is read from
    • and CURL_COOKIEJAR as the datastore that is written back to

    You do have to provide _COOKIEFILE with an empty string to enable it IIRC, but _COOKIEJAR if you want them stored. Normally set both options to the same name.

    0 讨论(0)
提交回复
热议问题