diff --git a/libsoup/soup-cookie.c b/libsoup/soup-cookie.c
old mode 100644
new mode 100755
index b10eba8..526aaad
--- a/libsoup/soup-cookie.c
+++ b/libsoup/soup-cookie.c
@@ -194,6 +194,23 @@ parse_value (const char **val_p)
 	return value;
 }
 
+static void
+skip_value (const char **val_p)
+{
+	const char *start, *end, *p;
+
+	p = *val_p;
+	if (*p == '=')
+		p++;
+	start = skip_lws (p);
+	for (p = start; !is_value_ender (*p); p++)
+		;
+	end = unskip_lws (p, start);
+
+	*val_p = p;
+	return;
+}
+
 static SoupDate *
 parse_date (const char **val_p)
 {
@@ -255,6 +272,10 @@ parse_one_cookie (const char *header, SoupURI *origin)
 			cookie->expires = parse_date (&p);
 		} else if (MATCH_NAME ("httponly")) {
 			cookie->http_only = TRUE;
+			/* Ignore the return value as this call is required
+			 * to move p to the end of this atribute.
+			 */
+			skip_value(&p);
 		} else if (MATCH_NAME ("max-age") && has_value) {
 			char *max_age_str = parse_value (&p), *mae;
 			long max_age = strtol (max_age_str, &mae, 10);
@@ -272,6 +293,10 @@ parse_one_cookie (const char *header, SoupURI *origin)
 			}
 		} else if (MATCH_NAME ("secure")) {
 			cookie->secure = TRUE;
+			/* Ignore the return value as this call is required
+			 * to move p to the end of this atribute.
+			 */
+			skip_value(&p);
 		} else {
 			/* Ignore unknown attributes, but we still have
 			 * to skip over the value.
