GNOME Bugzilla – Bug 677922
Add soup_cookie_jar_get_cookies() alternative that returns a GSList of SoupCookies
Last modified: 2012-06-12 15:07:46 UTC
Currently, the only way to efficiently retrieve the cookies for a specific URI is soup_cookie_jar_get_cookies(). However, this functions returns the cookies as a gchar*, in the format used by the Cookie header. In WebKit, we would benefit from a similar function that would return a GSList of SoupCookies for a specific URI. We need to retrieve existing cookies at some point to check if we are going to overwrite an existing cookie before adding a new one [1]. Using soup_cookie_jar_get_cookies() is not a viable option because the returned cookies are missing the PATH information (which is required for overwrite check). It would also involve an extra parsing of the cookies which is inefficient. [1] https://bugs.webkit.org/show_bug.cgi?id=88760
Created attachment 216171 [details] [review] Patch
Comment on attachment 216171 [details] [review] Patch basically looks good >+get_coookies (SoupCookieJar *jar, SoupURI *uri, gboolean for_http, gboolean one too many "o"s in the function name there :) also, you need to add soup_cookie_jar_get_cookie_list to docs/reference/libsoup-2.4-sections.txt (and do you have a GNOME git account or will you need me to commit this?)
Created attachment 216202 [details] [review] Patch Thanks for the quick review. Here is an update that takes your feedback into consideration. I have a gnome GIT account so I'll be able to commit once the patch is fine for you.
Comment on attachment 216202 [details] [review] Patch you can also feel free to bump the libsoup version to 2.39.2 in configure.ac if that would be useful for the webkit side
Committed in: http://git.gnome.org/browse/libsoup/commit/?id=c26f6718983d2ba5103f464497220ca1c51dd70e