line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojo::Cookie; |
2
|
60
|
|
|
60
|
|
448
|
use Mojo::Base -base; |
|
60
|
|
|
|
|
313
|
|
|
60
|
|
|
|
|
426
|
|
3
|
60
|
|
|
60
|
|
446
|
use overload bool => sub {1}, '""' => sub { shift->to_string }, fallback => 1; |
|
60
|
|
|
420
|
|
137
|
|
|
60
|
|
|
102
|
|
689
|
|
|
45
|
|
|
|
|
257
|
|
|
536
|
|
|
|
|
2242
|
|
4
|
|
|
|
|
|
|
|
5
|
60
|
|
|
60
|
|
6348
|
use Carp qw(croak); |
|
60
|
|
|
|
|
142
|
|
|
60
|
|
|
|
|
9243
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has [qw(name value)]; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
1
|
2509
|
sub parse { croak 'Method "parse" not implemented by subclass' } |
10
|
1
|
|
|
1
|
1
|
894
|
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 |