| 1 | package Dancer::Session::PSGI; | ||
| 2 | |||
| 3 | # ABSTRACT: Let Plack::Middleware::Session handle Dancer's session | ||
| 4 | |||
| 5 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | our $VERSION = '0.01'; | |
| 8 | |||
| 9 | 1 | ▶ | use Dancer::SharedData; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use base 'Dancer::Session::Abstract'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | # session_name can't be set in config for this module | ||
| 13 | sub session_name { | ||
| 14 | 0 | ▶ | "plack_session"; |
|
Subroutine
session_name: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 15 | } | ||
| 16 | |||
| 17 | sub create { | ||
| 18 | 0 | ▶ | return Dancer::Session::PSGI->new(); |
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 19 | } | ||
| 20 | |||
| 21 | sub retrieve { | ||
| 22 | 0 | ▶ | my ($class, $id) = @_; |
|
Subroutine
retrieve: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 23 | 0 | my $session = Dancer::SharedData->request->{env}->{'psgix.session'}; | |
| 24 | 0 | return Dancer::Session::PSGI->new(%$session); | |
| 25 | } | ||
| 26 | |||
| 27 | sub flush { | ||
| 28 | 0 | ▶ | my $self = shift; |
|
Subroutine
flush: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 29 | 0 | my $session = Dancer::SharedData->request->{env}->{'psgix.session'}; | |
| 30 | 0 | map {$session->{$_} = $self->{$_}} keys %$self; | |
| 31 | 0 | return $self; | |
| 32 | } | ||
| 33 | |||
| 34 | ▶ | sub destroy { | |
|
Subroutine
destroy: not called CC=1 SCAR=0.0
Pod
documented
| |||
| 35 | } | ||
| 36 | |||
| 37 | 1 | 1; | |
| 38 | |||
| 39 | |||
| 40 | __END__ | ||