Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie-Handling Problems #44

Open
andreasdorfer opened this issue Feb 1, 2017 · 1 comment
Open

Cookie-Handling Problems #44

andreasdorfer opened this issue Feb 1, 2017 · 1 comment

Comments

@andreasdorfer
Copy link

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.

@TobiasHauck
Copy link
Member

It's a good idea and I'm looking forward for your PR. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants