cURL / Mailing Lists / curl-library / Single Mail

curl-library

cookies

From: Arvind Sachdeva <asachdeva_at_gmail.com>
Date: Thu, 7 Jul 2005 16:48:19 +0530

Hi,
I am using curl in my app. I am trying to add elaborate cookie support
to it. I was surprised to find out that cookies are something that
curl associates with connection handle.

conceptually cookies are a url specific thing and not a connection
handle specific. Rather than the api curl_easy_setopt(easyhandle,
CURLOPT_COOKIE, cookie);
following would have been a better interface....

cookiejar = curl_cookiejar_init(filename);
curl_cookiejar_setcookie(cookiejar, url, cookie);
curl_easy_setopt(easyhandle, CURLOPT_COOKIEJAR, cookiejar);

Does curl exposes api's to deal with the cookie store ? Just setting
cookies is not enough ? I want to see what cookies are set for a given
url, also I want to set cookies per url. With the api's I know, it
seems I need to maintain my own cookie database which is a big
performance overhead since curl maintains a cookie database. With the
current api's, can anybody think of a better solution for associating
cookies with urls rather than connection handles.

-Arvind Sachdeva
Received on 2005-07-07