Newer Older
73 lines | 1.314kb
copy gitweblite soruce code
root authored on 2012-11-23
1
package Mojo::Cookie;
2
use Mojo::Base -base;
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
3
use overload bool => sub {1}, '""' => sub { shift->to_string }, fallback => 1;
copy gitweblite soruce code
root authored on 2012-11-23
4

            
5
use Carp 'croak';
6

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
7
has [qw(name value)];
copy gitweblite soruce code
root authored on 2012-11-23
8

            
9
sub parse     { croak 'Method "parse" not implemented by subclass' }
10
sub to_string { croak 'Method "to_string" not implemented by subclass' }
11

            
12
1;
13

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
14
=encoding utf8
15

            
copy gitweblite soruce code
root authored on 2012-11-23
16
=head1 NAME
17

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
18
Mojo::Cookie - HTTP cookie base class
copy gitweblite soruce code
root authored on 2012-11-23
19

            
20
=head1 SYNOPSIS
21

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
22
  package Mojo::Cookie::MyCookie;
copy gitweblite soruce code
root authored on 2012-11-23
23
  use Mojo::Base 'Mojo::Cookie';
24

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
25
  sub parse     {...}
26
  sub to_string {...}
27

            
copy gitweblite soruce code
root authored on 2012-11-23
28
=head1 DESCRIPTION
29

            
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
30
L<Mojo::Cookie> is an abstract base class for HTTP cookies as described in RFC
31
6265.
copy gitweblite soruce code
root authored on 2012-11-23
32

            
33
=head1 ATTRIBUTES
34

            
35
L<Mojo::Cookie> implements the following attributes.
36

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
37
=head2 name
copy gitweblite soruce code
root authored on 2012-11-23
38

            
39
  my $name = $cookie->name;
40
  $cookie  = $cookie->name('foo');
41

            
42
Cookie name.
43

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
44
=head2 value
copy gitweblite soruce code
root authored on 2012-11-23
45

            
46
  my $value = $cookie->value;
47
  $cookie   = $cookie->value('/test');
48

            
49
Cookie value.
50

            
51
=head1 METHODS
52

            
53
L<Mojo::Cookie> inherits all methods from L<Mojo::Base> and implements the
54
following new ones.
55

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
56
=head2 parse
copy gitweblite soruce code
root authored on 2012-11-23
57

            
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
58
  my $cookies = $cookie->parse($str);
copy gitweblite soruce code
root authored on 2012-11-23
59

            
60
Parse cookies. Meant to be overloaded in a subclass.
61

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
62
=head2 to_string
copy gitweblite soruce code
root authored on 2012-11-23
63

            
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
64
  my $str = $cookie->to_string;
65
  my $str = "$cookie";
copy gitweblite soruce code
root authored on 2012-11-23
66

            
67
Render cookie. Meant to be overloaded in a subclass.
68

            
69
=head1 SEE ALSO
70

            
71
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
72

            
73
=cut