From 92b54aacc0de5446dd5497c39897b0bbff72e626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 13 Jun 2018 09:54:12 +0200 Subject: Rebuild using Asciideck --- .../2.3/manual/cowboy_req.parse_cookies/index.html | 94 ++++++---------------- 1 file changed, 25 insertions(+), 69 deletions(-) (limited to 'docs/en/cowboy/2.3/manual/cowboy_req.parse_cookies/index.html') diff --git a/docs/en/cowboy/2.3/manual/cowboy_req.parse_cookies/index.html b/docs/en/cowboy/2.3/manual/cowboy_req.parse_cookies/index.html index 813c331f..855d20ad 100644 --- a/docs/en/cowboy/2.3/manual/cowboy_req.parse_cookies/index.html +++ b/docs/en/cowboy/2.3/manual/cowboy_req.parse_cookies/index.html @@ -62,91 +62,47 @@

cowboy_req:parse_cookies(3)

-

Name

-
-

cowboy_req:parse_cookies - Parse cookie headers

-
-
-
+

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 [].

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

Parse cookie headers.

+

Alias for cowboy_req:parse_header(<<"cookie">>, Req).

+

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. -

+
Req
+

The Req object.

-
-
- -
+

Return value

-
-

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

-
-
-
+

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: 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. -

      +
    • 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).
-
-
-
+
Cookies = cowboy_req:parse_cookies(Req),
+{_, Token} = lists:keyfind(<<"token">>, 1, Cookies).
+

See also

-
- -
- +

cowboy_req(3), cowboy_req:parse_header(3), cowboy_req:match_cookies(3)

+ -- cgit v1.2.3