line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Ark::Plugin::Session; |
2
|
10
|
|
|
10
|
|
3769
|
use strict; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
246
|
|
3
|
10
|
|
|
10
|
|
43
|
use warnings; |
|
10
|
|
|
|
|
17
|
|
|
10
|
|
|
|
|
210
|
|
4
|
10
|
|
|
10
|
|
3351
|
use Ark::Plugin; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has session => ( |
7
|
|
|
|
|
|
|
is => 'rw', |
8
|
|
|
|
|
|
|
isa => 'Ark::Plugin::Session::Backend', |
9
|
|
|
|
|
|
|
lazy => 1, |
10
|
|
|
|
|
|
|
default => sub { |
11
|
|
|
|
|
|
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $conf = $self->app->config->{'Plugin::Session'} || {}; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
$self->app->ensure_class_loaded('Ark::Plugin::Session::Backend'); |
16
|
|
|
|
|
|
|
my $class = $self->app->class_wrapper( |
17
|
|
|
|
|
|
|
name => 'Session', |
18
|
|
|
|
|
|
|
base => 'Ark::Plugin::Session::Backend', |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$class->new(%$conf, app => $self->app); |
22
|
|
|
|
|
|
|
}, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
before finalize => sub { |
26
|
|
|
|
|
|
|
my $context = shift; |
27
|
|
|
|
|
|
|
return unless $context->{session}; |
28
|
|
|
|
|
|
|
$context->session->finalize_session( $context->response ); |
29
|
|
|
|
|
|
|
}; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |