Use Cookies on Windows, with Curl?

I need to use cookies on Windows. I am thinking using Curl, but it seems that setting JUCE_USE_CURL=1 does not actually use Curl.
Everything work on OSX.

How can I handle cookies with Windows?

Thank you,

I need to use cookies on Windows.

I’ve just recently solved this on iOS. The idea is to manually add the cookie sent by the server to the cookie store.

For example:

	StringPairArray responseHeaders;
	auto response = url.createInputStream(true, nullptr, nullptr, String(), 0, &responseHeaders, &statusCode);
	//Get the cookie sent by the server
	auto cookie = responseHeaders.getValue("Set-Cookie", "");

Now, on iOS there is NSHTTPCookieStorage which has the handy function setCookies:forURL…
Use that and all subsequent HTTP requests will forward the cookie to the server.

The Windows equivalent is InternetSetCookie(); JUCE uses WinInet to work with HTTP so it should work, but I haven’t tried it myself.

It wouldn’t hurt if JUCE provided a cross-platform abstraction for setting/reading cookies - is there a reason not to ?

Hi bcn-flor, I am actually bumping on the same issue again (see here). Once you get the cookies, how do you send them back to the server for let’s say using the same url but with a post method?