| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Catalyst::Plugin::Session::State; |
|
4
|
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
31
|
use strict; |
|
|
2
|
|
|
|
|
28
|
|
|
|
2
|
|
|
|
|
32
|
|
|
6
|
2
|
|
|
2
|
|
33
|
use warnings; |
|
|
2
|
|
|
|
|
18
|
|
|
|
2
|
|
|
|
|
33
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
__END__ |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=pod |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Catalyst::Plugin::Session::State - Base class for session state |
|
17
|
|
|
|
|
|
|
preservation plugins. |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package Catalyst::Plugin::Session::State::MyBackend; |
|
22
|
|
|
|
|
|
|
use base qw/Catalyst::Plugin::Session::State/; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This class doesn't actually provide any functionality, but when the |
|
27
|
|
|
|
|
|
|
C<Catalyst::Plugin::Session> module sets up it will check to see that |
|
28
|
|
|
|
|
|
|
C<< YourApp->isa("Catalyst::Plugin::Session::State") >>. |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
When you write a session state plugin you should subclass this module this |
|
31
|
|
|
|
|
|
|
reason only. |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 WRITING STATE PLUGINS |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
To write a session state plugin you usually need to extend two methods: |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=over 4 |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=item prepare_(action|cookies|whatever) |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Set C<sessionid> (accessor) at B<prepare> time using data in the request. |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Note that this must happen B<before> other C<prepare_action> instances, in |
|
44
|
|
|
|
|
|
|
order to get along with L<Catalyst::Plugin::Session>. Overriding |
|
45
|
|
|
|
|
|
|
C<prepare_cookies> is probably the stablest approach. |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=item finalize |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Modify the response at to include the session ID if C<sessionid> is defined, |
|
50
|
|
|
|
|
|
|
using whatever scheme you use. For example, set a cookie, |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=back |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|