Any way to keep curl's cookies in memory and not on disk

前端 未结 6 529
-上瘾入骨i
-上瘾入骨i 2020-12-01 09:09

I\'m doing some cURL work in php 5.3.0.

I\'m wondering if there is any way to tell the curl handle/object to keep the cookies in memory (assuming I\'m reusing the sa

6条回答
  •  无人及你
    2020-12-01 09:38

    What works for me is using this setting:

    curl_setopt($ch, CURLOPT_HEADER, 1);
    

    And then parsing the result. Details in this blog post where I found out how to do this.
    And since that is old, here is a gist replacing deprecated functions.

提交回复
热议问题