gchar* temporary_filename = NULL;
GSList* cookies;
- http_cookies->timeout = 0;
+ if (http_cookies->timeout > 0)
+ {
+ g_source_remove (http_cookies->timeout);
+ http_cookies->timeout = 0;
+ }
temporary_filename = g_strconcat (http_cookies->filename, ".XXXXXX", NULL);
if ((fn = g_mkstemp (temporary_filename)) == -1)
SoupSession* session)
{
KatzeHttpCookies* http_cookies = (KatzeHttpCookies*)feature;
- if (http_cookies->timeout)
+ if (http_cookies->timeout > 0)
katze_http_cookies_update_jar (http_cookies);
katze_assign (http_cookies->filename, NULL);
katze_object_assign (http_cookies->jar, NULL);
SoupSession* session = webkit_get_default_session ();
SoupSessionFeature* jar = soup_session_get_feature (session, SOUP_TYPE_COOKIE_JAR);
GSList* cookies = soup_cookie_jar_all_cookies (SOUP_COOKIE_JAR (jar));
+ SoupSessionFeature* feature;
+
for (; cookies != NULL; cookies = g_slist_next (cookies))
{
SoupCookie* cookie = cookies->data;
- soup_cookie_set_max_age (cookie, 0);
- soup_cookie_free (cookie);
+ soup_cookie_jar_delete_cookie ((SoupCookieJar*)jar, cookie);
}
- g_slist_free (cookies);
+ soup_cookies_free (cookies);
/* Removing KatzeHttpCookies makes it save outstanding changes */
- if (soup_session_get_feature (session, KATZE_TYPE_HTTP_COOKIES))
+ if ((feature = soup_session_get_feature (session, KATZE_TYPE_HTTP_COOKIES)))
{
- soup_session_remove_feature_by_type (session, KATZE_TYPE_HTTP_COOKIES);
- soup_session_add_feature_by_type (session, KATZE_TYPE_HTTP_COOKIES);
+ g_object_ref (feature);
+ soup_session_remove_feature (session, feature);
+ soup_session_add_feature (session, feature);
+ g_object_unref (feature);
}
}