| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mojolicious::Sessions::ThreeS::State; |
|
2
|
|
|
|
|
|
|
$Mojolicious::Sessions::ThreeS::State::VERSION = '0.004'; |
|
3
|
2
|
|
|
2
|
|
717
|
use Mojo::Base -base; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
13
|
|
|
4
|
2
|
|
|
2
|
|
242
|
use Carp; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
198
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Mojolicious::Sessions::ThreeS::State - Abstract session state manager |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Implement a subclass of this using C and implement |
|
13
|
|
|
|
|
|
|
all methods marked as ABSTRACT |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head2 get_session_id |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
ABSTRACT |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Return the current session_id if such a thing exists. Undef otherwise. |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Called by the framework like this: |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
if( my $session_id = $this->get_session_id( $controller ) ){ |
|
26
|
|
|
|
|
|
|
... |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub get_session_id{ |
|
32
|
0
|
|
|
0
|
1
|
|
confess("Implement this"); |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head2 set_session_id |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
ABSTRACT |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Sets the given session_id against the client using the given L |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Called by the framework like this: |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$this->set_session_id( $controller, $session_id , \%options ); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Options can include: |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
expires: an epoch at which to expire the state. Please make your best effort to respect this if present. |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub set_session_id{ |
|
52
|
0
|
|
|
0
|
1
|
|
confess("Implement this"); |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |