You can use the CURLOPT_COOKIEJAR
option, and set the file to “/dev/null
” for Linux / MacOS X or “NULL
” for Windows. This will prevent the cookies from being written to disk, but it will keep them around in memory as long as you reuse the handle and don’t call curl_easy_cleanup()
.