CSRF, HttpClient, HttpCookie and undefined references

Hi there again :smile:

I’m trying to consume a REST API made with Django using for that HttpClient.

In order to do so, I need to get first the CSRF token witch is sent to me via cookie. Now, I need to get that Cookie value that I got (I enabled already the HttpClient to handle cookies, and I already have it on my cookies file) and create a header X-CSRFToken in order to send my requests.

I’m having no problems till the moment I need to get my cookie value. I’m trying to do it via accessing it through my HttpClient such as:

const std::vector<CookiesInfo>* cookieList = HttpClient::getInstance()->getCookie()->getCookies();

When I try to do so, I get an error:

error: undefined reference to 'HttpCookie::getCookies() const'

I’m importing #include “network/HttpCookie.h” and I can even get to see the “getCookies()” code inside the HttpCookie.cpp file.

Am I missing something? I’ve been looking for a while but I can’t see any information online about it. Even the documentation for my cocos2dx version (3.8) does not have the HttpCookie class inside.

Is there any way to do this in an easier way? Or am I already heading in the right direction?

Thanks in advance

Well, I managed to get around this problem and to get the cookie value by other means, not so appropiate, but useful anyway.

I got the cookieFile open getting the filename vía HttClient and parse it till I get the cookie name, and with it I get the cookie value.

As I said, not elegant, but It does the work for now.