line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Cookie; |
2
|
61
|
|
|
61
|
|
462
|
use Mojo::Base -base; |
|
61
|
|
|
|
|
155
|
|
|
61
|
|
|
|
|
526
|
|
3
|
61
|
|
|
61
|
|
511
|
use overload bool => sub {1}, '""' => sub { shift->to_string }, fallback => 1; |
|
61
|
|
|
331
|
|
167
|
|
|
61
|
|
|
250
|
|
722
|
|
|
45
|
|
|
|
|
267
|
|
|
536
|
|
|
|
|
2271
|
|
4
|
|
|
|
|
|
|
|
5
|
61
|
|
|
61
|
|
6405
|
use Carp qw(croak); |
|
61
|
|
|
|
|
188
|
|
|
61
|
|
|
|
|
9790
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has [qw(name value)]; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
1
|
2943
|
sub parse { croak 'Method "parse" not implemented by subclass' } |
10
|
1
|
|
|
1
|
1
|
953
|
sub to_string { croak 'Method "to_string" not implemented by subclass' } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=encoding utf8 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Mojo::Cookie - HTTP cookie base class |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 SYNOPSIS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
package Mojo::Cookie::MyCookie; |
23
|
|
|
|
|
|
|
use Mojo::Base 'Mojo::Cookie'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub parse {...} |
26
|
|
|
|
|
|
|
sub to_string {...} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
L is an abstract base class for HTTP cookie containers, based on L
|
31
|
|
|
|
|
|
|
6265|https://tools.ietf.org/html/rfc6265>, like L and L. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
L implements the following attributes. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 name |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $name = $cookie->name; |
40
|
|
|
|
|
|
|
$cookie = $cookie->name('foo'); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Cookie name. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 value |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $value = $cookie->value; |
47
|
|
|
|
|
|
|
$cookie = $cookie->value('/test'); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Cookie value. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 METHODS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
L inherits all methods from L and implements the following new ones. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 parse |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $cookies = $cookie->parse($str); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Parse cookies. Meant to be overloaded in a subclass. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 to_string |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
my $str = $cookie->to_string; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Render cookie. Meant to be overloaded in a subclass. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 OPERATORS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
L overloads the following operators. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 bool |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
my $bool = !!$cookie; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Always true. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 stringify |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
my $str = "$cookie"; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Alias for L"to_string">. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SEE ALSO |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L, L, L. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |