0cc8a465d7c12b21495f78f60b8843752451c7f3
diff --git a/libsoup/soup-cookie-jar.c b/libsoup/soup-cookie-jar.c
index 42b8697..4e15a2d 100644
--- a/libsoup/soup-cookie-jar.c
+++ b/libsoup/soup-cookie-jar.c
@@ -311,3 +311,33 @@ request_unqueued (SoupSessionFeature *feature, SoupSession *session,
 	g_signal_handlers_disconnect_by_func (msg, process_set_cookie_header, feature);
 }
 
+/**
+ * soup_cookie_jar_all_cookies:
+ * @jar: a #SoupCookieJar
+ *
+ * Constructs a #GSList with every cookie inside the @jar.
+ *
+ * Return value: a #GSList with all the cookies in the @jar.
+ **/
+GSList *
+soup_cookie_jar_all_cookies (SoupCookieJar *jar)
+{
+	SoupCookieJarPrivate *priv;
+	GHashTableIter iter;
+	GSList *l = NULL;
+	gpointer key, value;
+
+	g_return_val_if_fail (SOUP_IS_COOKIE_JAR (jar), NULL);
+
+	priv = SOUP_COOKIE_JAR_GET_PRIVATE (jar);
+
+	g_hash_table_iter_init (&iter, priv->domains);
+
+	while (g_hash_table_iter_next (&iter, &key, &value)) {
+		GSList *p, *cookies = value;
+		for (p = cookies; p; p = p->next)
+			l = g_slist_prepend (l, p->data);
+	}
+
+	return l;
+}
diff --git a/libsoup/soup-cookie-jar.h b/libsoup/soup-cookie-jar.h
index f58860f..7e61c73 100644
--- a/libsoup/soup-cookie-jar.h
+++ b/libsoup/soup-cookie-jar.h
@@ -43,5 +43,6 @@ void           soup_cookie_jar_set_cookie          (SoupCookieJar *jar,
 						    const char    *cookie);
 void           soup_cookie_jar_set_cookie_internal (SoupCookieJar *jar,
 						    SoupCookie    *cookie);
+GSList        *soup_cookie_jar_all_cookies         (SoupCookieJar *jar);
 
 #endif /* SOUP_COOKIE_JAR_H */
