aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/gun_cookies.domain_match.asciidoc
blob: 34f52ec461aa5a9179c9f68c4a28d1d526983dbc (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
51
52
= gun_cookies:domain_match(3)

== Name

gun_cookies:domain_match - Cookie domain match

== Description

[source,erlang]
----
domain_match(String, DomainString) -> boolean()

String       :: binary()
DomainString :: binary()
----

Cookie domain match.

This function can be used when implementing the
`set_cookie_secure_match` callback of a cookie store.

== Arguments

String::

The string to match.

DomainString::

The domain string that will be matched against.

== Return value

Returns `true` when `String` domain-matches `DomainString`,
and `false` otherwise.

== Changelog

* *2.0*: Function introduced.

== Examples

.Perform a domain match
[source,erlang]
----
Match = gun_cookies:domain_match(Domain, CookieDomain).
----

== See also

link:man:gun_cookies(3)[gun_cookies(3)],
link:man:gun_cookies:path_match(3)[gun_cookies:path_match(3)]