1Mojo::Cookie::Response(U3s)er Contributed Perl DocumentatMioojno::Cookie::Response(3)
2
3
4

NAME

6       Mojo::Cookie::Response - HTTP response cookie
7

SYNOPSIS

9         use Mojo::Cookie::Response;
10
11         my $cookie = Mojo::Cookie::Response->new;
12         $cookie->name('foo');
13         $cookie->value('bar');
14         say "$cookie";
15

DESCRIPTION

17       Mojo::Cookie::Response is a container for HTTP response cookies, based
18       on RFC 6265 <http://tools.ietf.org/html/rfc6265>.
19

ATTRIBUTES

21       Mojo::Cookie::Response inherits all attributes from Mojo::Cookie and
22       implements the following new ones.
23
24   domain
25         my $domain = $cookie->domain;
26         $cookie    = $cookie->domain('localhost');
27
28       Cookie domain.
29
30   expires
31         my $expires = $cookie->expires;
32         $cookie     = $cookie->expires(time + 60);
33
34       Expiration for cookie.
35
36   host_only
37         my $bool = $cookie->host_only;
38         $cookie  = $cookie->host_only($bool);
39
40       Host-only flag, indicating that the canonicalized request-host is
41       identical to the cookie's "domain".
42
43   httponly
44         my $bool = $cookie->httponly;
45         $cookie  = $cookie->httponly($bool);
46
47       HttpOnly flag, which can prevent client-side scripts from accessing
48       this cookie.
49
50   max_age
51         my $max_age = $cookie->max_age;
52         $cookie     = $cookie->max_age(60);
53
54       Max age for cookie.
55
56   path
57         my $path = $cookie->path;
58         $cookie  = $cookie->path('/test');
59
60       Cookie path.
61
62   secure
63         my $bool = $cookie->secure;
64         $cookie  = $cookie->secure($bool);
65
66       Secure flag, which instructs browsers to only send this cookie over
67       HTTPS connections.
68

METHODS

70       Mojo::Cookie::Response inherits all methods from Mojo::Cookie and
71       implements the following new ones.
72
73   parse
74         my $cookies = Mojo::Cookie::Response->parse('f=b; path=/');
75
76       Parse cookies.
77
78   to_string
79         my $str = $cookie->to_string;
80
81       Render cookie.
82

SEE ALSO

84       Mojolicious, Mojolicious::Guides, <https://mojolicious.org>.
85
86
87
88perl v5.28.0                      2018-05-08         Mojo::Cookie::Response(3)
Impressum