e661edc84457becaaff447f000f911431a9a86a0
diff --git a/libsoup/soup-cookie.c b/libsoup/soup-cookie.c
index 5830a76..0b2e017 100644
--- a/libsoup/soup-cookie.c
+++ b/libsoup/soup-cookie.c
@@ -127,6 +127,38 @@
  * ~/src/mozilla/netwerk/test/TestCookie.cpp
  */
 
+GType
+soup_cookie_get_type (void)
+{
+	static GType type = 0;
+
+	if (G_UNLIKELY (type == 0))
+	{
+		type = g_boxed_type_register_static ("SoupCookie",
+						     (GBoxedCopyFunc) soup_cookie_copy,
+						     (GBoxedFreeFunc) soup_cookie_free);
+	}
+
+	return type;
+}
+
+SoupCookie *
+soup_cookie_copy (const SoupCookie *cookie)
+{
+	SoupCookie *copy = g_slice_new0 (SoupCookie);
+
+	copy->name = g_strdup (cookie->name);
+	copy->value = g_strdup (cookie->value);
+	copy->domain = g_strdup (cookie->domain);
+	copy->path = g_strdup (cookie->path);
+	if (cookie->expires)
+		copy->expires = soup_date_copy(cookie->expires);
+	copy->secure = cookie->secure;
+	copy->http_only = cookie->http_only;
+
+	return copy;
+}
+
 static gboolean
 domain_matches (const char *domain, const char *host)
 {
diff --git a/libsoup/soup-cookie.h b/libsoup/soup-cookie.h
index 2c1bad4..a4ec23f 100644
--- a/libsoup/soup-cookie.h
+++ b/libsoup/soup-cookie.h
@@ -20,55 +20,50 @@ struct _SoupCookie {
 	gboolean  http_only;
 };
 
+#define SOUP_TYPE_COOKIE             (soup_cookie_get_type())
 #define SOUP_COOKIE_MAX_AGE_ONE_HOUR (60 * 60)
 #define SOUP_COOKIE_MAX_AGE_ONE_DAY  (SOUP_COOKIE_MAX_AGE_ONE_HOUR * 24)
 #define SOUP_COOKIE_MAX_AGE_ONE_WEEK (SOUP_COOKIE_MAX_AGE_ONE_DAY * 7)
 #define SOUP_COOKIE_MAX_AGE_ONE_YEAR (SOUP_COOKIE_MAX_AGE_ONE_DAY * 365.2422)
 
-SoupCookie *soup_cookie_new                     (const char  *name,
-						 const char  *value,
-						 const char  *domain,
-						 const char  *path,
-						 int          max_age);
-SoupCookie *soup_cookie_parse                   (const char  *header,
-						 SoupURI     *origin);
-
-void        soup_cookie_set_name                (SoupCookie  *cookie,
-						 const char  *name);
-void        soup_cookie_set_value               (SoupCookie  *cookie,
-						 const char  *value);
-void        soup_cookie_set_domain              (SoupCookie  *cookie,
-						 const char  *domain);
-void        soup_cookie_set_path                (SoupCookie  *cookie,
-						 const char  *path);
-void        soup_cookie_set_max_age             (SoupCookie  *cookie,
-						 int          max_age);
-void        soup_cookie_set_expires             (SoupCookie  *cookie,
-						 SoupDate    *expires);
-void        soup_cookie_set_secure              (SoupCookie  *cookie,
-						 gboolean     secure);
-void        soup_cookie_set_http_only           (SoupCookie  *cookie,
-						 gboolean     http_only);
-
-char       *soup_cookie_to_set_cookie_header    (SoupCookie  *cookie);
-char       *soup_cookie_to_cookie_header        (SoupCookie  *cookie);
-
-void        soup_cookie_free                    (SoupCookie  *cookie);
-
-GSList     *soup_cookies_from_response          (SoupMessage *msg);
-GSList     *soup_cookies_from_request           (SoupMessage *msg);
-
-void        soup_cookies_to_response            (GSList      *cookies,
-						 SoupMessage *msg);
-void        soup_cookies_to_request             (GSList      *cookies,
-						 SoupMessage *msg);
-
-void        soup_cookies_free                   (GSList      *cookies);
-
-char       *soup_cookies_to_cookie_header       (GSList      *cookies);
-
-gboolean    soup_cookie_applies_to_uri          (SoupCookie  *cookie,
-						 SoupURI     *uri);
+GType       soup_cookie_get_type             (void);
+SoupCookie *soup_cookie_new                  (const char       *name,
+					      const char       *value,
+					      const char       *domain,
+					      const char       *path,
+					      int               max_age);
+SoupCookie *soup_cookie_copy                 (const SoupCookie *cookie);
+SoupCookie *soup_cookie_parse                (const char       *header,
+					      SoupURI          *origin);
+void        soup_cookie_set_name             (SoupCookie       *cookie,
+					      const char       *name);
+void        soup_cookie_set_value            (SoupCookie       *cookie,
+					      const char       *value);
+void        soup_cookie_set_domain           (SoupCookie       *cookie,
+					      const char       *domain);
+void        soup_cookie_set_path             (SoupCookie       *cookie,
+					      const char       *path);
+void        soup_cookie_set_max_age          (SoupCookie       *cookie,
+					      int               max_age);
+void        soup_cookie_set_expires          (SoupCookie       *cookie,
+					      SoupDate         *expires);
+void        soup_cookie_set_secure           (SoupCookie       *cookie,
+					      gboolean          secure);
+void        soup_cookie_set_http_only        (SoupCookie       *cookie,
+					      gboolean          http_only);
+char       *soup_cookie_to_set_cookie_header (SoupCookie       *cookie);
+char       *soup_cookie_to_cookie_header     (SoupCookie       *cookie);
+void        soup_cookie_free                 (SoupCookie       *cookie);
+GSList     *soup_cookies_from_response       (SoupMessage      *msg);
+GSList     *soup_cookies_from_request        (SoupMessage      *msg);
+void        soup_cookies_to_response         (GSList           *cookies,
+					      SoupMessage      *msg);
+void        soup_cookies_to_request          (GSList           *cookies,
+					      SoupMessage      *msg);
+void        soup_cookies_free                (GSList           *cookies);
+char       *soup_cookies_to_cookie_header    (GSList           *cookies);
+gboolean    soup_cookie_applies_to_uri       (SoupCookie       *cookie,
+					      SoupURI          *uri);
 
 G_END_DECLS
 
