-
Notifications
You must be signed in to change notification settings - Fork 20
Description
I encountered a problem working with cookies:
Calling an REST-auth-interface which relies on cookies, the data was not saved to the CURLOPT_COOKIEFILE.
CURL saves cookies when the handle is closed (see here: https://curl.haxx.se/docs/http-cookies.html). Obviously the method "sendRequest" in the Class "Curl" resets all options BEFORE the handle is closed. This way options like CURLOPT_COOKIEFILE, and CURLOPT_COOKIEJAR are ignored - nothing is saved.
Basically I think, after doing some testing and research I think it's not an good idea to use the same curl handle for different calls (with different options).
I would suggest to move the curl_init- and curl_close functions to the sendRequest-method, so that curl is initialised and closed properly at each request.
I am going to create an corresponding pull request.