Is it impossible to share cookie when accessing url multiple times with the same curl instance in php?

$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL            => "http://www.test.com/page1",
));
curl_setopt_array($curl, array(
    CURLOPT_URL            => "http://www.test.com/page2",
));
curl_close($curl);

as in the above code, use the same $curl instance to send multiple requests. First, visit http://www.test.com/page1. Will the server return cookie, and then will not automatically bring the cookie returned by the server when visiting http://www.test.com/page2?
the actual measurement does not take the cookie, verification of the previous request.
that is, even if it is the same curl instance, the cookie requested each time is isolated (separate)?

< hr >

A solution has been found: http://php.net/manual/zh/func.

Mar.31,2021

you can see that https://mp.weixin.qq.com/s/OB.


is independent each time. The default is


has found a solution http://php.net/manual/zh/func.

without cookie.
Menu