line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Prancer::Session::State::Cookie; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1720
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
26
|
|
|
1
|
|
|
|
|
28
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use version; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
4
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.04'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
473
|
use Plack::Session::State::Cookie; |
|
1
|
|
|
|
|
3707
|
|
|
1
|
|
|
|
|
25
|
|
10
|
1
|
|
|
1
|
|
4
|
use parent qw(Plack::Session::State::Cookie); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
1; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Prancer::Session::State::Cookie |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This package implements a session state handler that will keep track of |
21
|
|
|
|
|
|
|
sessions by adding a cookie into the response headers and reading cookies in |
22
|
|
|
|
|
|
|
the request headers. You must enable this if you want sessions to work. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
To use this session state handler, add this to your configuration file: |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
session: |
27
|
|
|
|
|
|
|
state: |
28
|
|
|
|
|
|
|
driver: Prancer::Session::State::Cookie |
29
|
|
|
|
|
|
|
options: |
30
|
|
|
|
|
|
|
key: PSESSION |
31
|
|
|
|
|
|
|
path: / |
32
|
|
|
|
|
|
|
domain: .example.com |
33
|
|
|
|
|
|
|
expires: 1800 |
34
|
|
|
|
|
|
|
secure: 1 |
35
|
|
|
|
|
|
|
httponly: 1 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 OPTIONS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=over 4 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item key |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
The name of the cookie. The default is B. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item path |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
The path of the cookie. This defaults to "/". |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item domain |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
The domain for the cookie. If this is not set then it will not be included in |
52
|
|
|
|
|
|
|
the cookie. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item expires |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
The expiration time of the cookie in seconds. If this is not set then it will |
57
|
|
|
|
|
|
|
not be included in the cookie which means that sessions will expire at the end |
58
|
|
|
|
|
|
|
of the user's browser session. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item secure |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
The secure flag for the cookie. If this is not set then it will not be included |
63
|
|
|
|
|
|
|
in the cookie. If this is set to a true value then the cookie will only be |
64
|
|
|
|
|
|
|
transmitted over secure connections. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=item httponly |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
The HttpOnly flag for the cookie. If this is not set then it will not be |
69
|
|
|
|
|
|
|
included in the cookie. If this is set to a true value then the cookie will |
70
|
|
|
|
|
|
|
only be accessible by the server and not by, say, JavaScript. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=back |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |