You should only call curl_close()when you know that you are done with this particular descriptor, or if the transition from the current state to the new one (i.e. changing a ton of options with the help curl_setopt()will be faster, going from a clean new handle than your current "dirty" one.
The cookiejar / file parameters are strictly necessary to support cookies between individual / invokations handles. Each of them is independent of the others, therefore cookies are the only way to exchange between them.
source
share