cURL - 需要在不同的脚本中使用相同的会话 Cookie


cURL - Need to use same session cookie in different scripts

每次运行我的 cURL 会话时都会生成一个新的 cookie。如何对不同的脚本使用相同的 Cookie?

我的设置:

curl_setopt($curl, CURLOPT_COOKIESESSION, false);
curl_setopt($curl, CURLOPT_COOKIEFILE, $cookiefilename);
curl_setopt($curl, CURLOPT_COOKIEJAR, $cookiefilename); 

谢谢!

你试过使用 True 吗?

curl_setopt($curl, CURLOPT_COOKIESESSION, true);您是否验证了 Cookie 正在写入$cookiefilename?
您是否尝试在 cookie 的持续时间内"重新运行"脚本?

您正在尝试重复使用 Cookie?