aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/cow_cookie.parse_cookie.asciidoc
blob: 2f27d7dff56b0a3c50231496691a085152bfaca1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
= cow_cookie:parse_cookie(3)

== Name

cow_cookie:parse_cookie - Parse a cookie header

== Description

[source,erlang]
----
parse_cookie(Cookie :: binary())
    -> [{binary(), binary()}]
----

Parse a cookie header.

== Arguments

Cookie::

The cookie header value.

== Return value

A list of cookie name/value pairs is returned on success.

An exception is thrown in the event of a parse error.

== Changelog

* *2.9*: Fixes to the parser may lead to potential incompatibilities.
         A cookie name starting with `$` is no longer ignored.
         A cookie without a `=` will be parsed as the value of
         the cookie named `<<>>` (empty name).
* *1.0*: Function introduced.

== Examples

.Parse a cookie header
[source,erlang]
----
Cookies = cow_cookie:parse_cookie(CookieHd).
----

== See also

link:man:cow_cookie(3)[cow_cookie(3)],
link:man:cow_cookie:parse_set_cookie(3)[cow_cookie:parse_set_cookie(3)],
link:man:cow_cookie:cookie(3)[cow_cookie:cookie(3)],
link:man:cow_cookie:setcookie(3)[cow_cookie:setcookie(3)]