summaryrefslogtreecommitdiff
path: root/lib/cookie.h
diff options
context:
space:
mode:
authorDaniel Gustafsson <daniel@yesql.se>2019-02-17 00:09:30 +0100
committerDaniel Gustafsson <daniel@yesql.se>2019-02-17 00:09:30 +0100
commite6522522f96ad96b459e608c6cdcd46a32099b5b (patch)
tree34c27ca15b6292ed1cd9afe46cdc9176fbcedbc7 /lib/cookie.h
parent0299b262cd9c75adab546f4851c03995d98d61e1 (diff)
downloadcurl-e6522522f96ad96b459e608c6cdcd46a32099b5b.tar.gz
cookie: Add support for cookie prefixes
The draft-ietf-httpbis-rfc6265bis-02 draft, specify a set of prefixes and how they should affect cookie initialization, which has been adopted by the major browsers. This adds support for the two prefixes defined, __Host- and __Secure, and updates the testcase with the supplied examples from the draft. Closes #3554 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Diffstat (limited to 'lib/cookie.h')
-rw-r--r--lib/cookie.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/cookie.h b/lib/cookie.h
index 3ee457c62..b2730cfb9 100644
--- a/lib/cookie.h
+++ b/lib/cookie.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -44,8 +44,16 @@ struct Cookie {
bool livecookie; /* updated from a server, not a stored file */
bool httponly; /* true if the httponly directive is present */
int creationtime; /* time when the cookie was written */
+ unsigned char prefix; /* bitmap fields indicating which prefix are set */
};
+/*
+ * Available cookie prefixes, as defined in
+ * draft-ietf-httpbis-rfc6265bis-02
+ */
+#define COOKIE_PREFIX__SECURE (1<<0)
+#define COOKIE_PREFIX__HOST (1<<1)
+
#define COOKIE_HASH_SIZE 256
struct CookieInfo {