From 1b863c350ba1f9b8ad1cb458df514ab0fe6bb127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 11 Dec 2017 11:27:17 +0100 Subject: Add documentation for Cowboy 2.2 --- .../2.2/manual/cowboy_req.parse_cookies/index.html | 228 +++++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 docs/en/cowboy/2.2/manual/cowboy_req.parse_cookies/index.html (limited to 'docs/en/cowboy/2.2/manual/cowboy_req.parse_cookies/index.html') diff --git a/docs/en/cowboy/2.2/manual/cowboy_req.parse_cookies/index.html b/docs/en/cowboy/2.2/manual/cowboy_req.parse_cookies/index.html new file mode 100644 index 00000000..80d626dc --- /dev/null +++ b/docs/en/cowboy/2.2/manual/cowboy_req.parse_cookies/index.html @@ -0,0 +1,228 @@ + + + + + + + + + + + + Nine Nines: cowboy_req:parse_cookies(3) + + + + + + + + + + + + + + + + +
+
+
+
+ +

cowboy_req:parse_cookies(3)

+ +
+

Name

+
+

cowboy_req:parse_cookies - Parse cookie headers

+
+
+
+

Description

+
+
+
+
parse_cookies(Req) -> [{Name, Value}]
+
+Name  :: binary() %% case sensitive
+Value :: binary() %% case sensitive
+

Parse cookie headers.

+ +

When the cookie header is missing, [] is returned.

+

While an empty cookie header is not valid, some clients do +send it. Cowboy will in this case also return [].

+
+
+
+

Arguments

+
+
+
+Req +
+
+

+The Req object. +

+
+
+
+
+
+

Return value

+
+

The cookies are returned as a list of key/values. Keys and +values are case sensitive binary strings.

+
+
+
+

Changelog

+
+
    +
  • +

    +2.0: Only the parsed header value is returned, it is no longer wrapped in a tuple. +

    +
  • +
  • +

    +2.0: Function introduced. Replaces cookie/2,3 and cookies/1. +

    +
  • +
+
+
+
+

Examples

+
+
+
Look for a specific cookie
+
+
Cookies = cowboy_req:parse_cookies(Req),
+{_, Token} = lists:keyfind(token, 1, Cookies).
+
+
+ + + + + + +
+ +
+ + +

+ Cowboy + 2.2 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+ + +
+
+
+
+ + + + + + + + + -- cgit v1.2.3