https://bitbucket.org/moriarty/curlpp/src/ac658073c87a/examples/example07.cpp
This example seems to have what you want. In particular, this code:
std::cout << "\nCookies from cookie engine:" << std::endl;
std::list<std::string> cookies;
curlpp::infos::CookieList::get(exEasy, cookies);
int i = 1;
for (std::list<std::string>::const_iterator it = cookies.begin(); it != cookies.end(); ++it, i++)
{
std::cout << "[" << i << "]: " << MakeCookie(*it) << std::endl;
}
Note that MakeCookie returns a structure called MyCookie in this example, so you will also need:
struct MyCookie
{
std::string name;
std::string value;
std::string domain;
std::string path;
time_t expires;
bool tail;
bool secure;
};
MyCookie
MakeCookie(const std::string &str_cookie)
{
std::vector<std::string> vC = splitCookieStr(str_cookie);
MyCookie cook;
cook.domain = vC[0];
cook.tail = vC[1] == "TRUE";
cook.path = vC[2];
cook.secure = vC[3] == "TRUE";
cook.expires = StrToInt(vC[4]);
cook.name = vC[5];
cook.value = vC[6];
return cook;
}
user1508519
source
share