| 1 | package Yeb::Plugin::Session; | ||
| 2 | 1 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | $Yeb::Plugin::Session::AUTHORITY = 'cpan:GETTY'; | |
| 4 | } | ||
| 5 | # ABSTRACT: Yeb Plugin for Plack::Middleware::Session | ||
| 6 | 1 | $Yeb::Plugin::Session::VERSION = '0.100'; | |
| 7 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use Plack::Middleware::Session; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | use Plack::Session::Store::File; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 1 | has app => ( is => 'ro', required => 1, weak_ref => 1 ); | |
| 12 | |||
| 13 | 0 | ▶ | sub BUILD { |
|
Subroutine
BUILD: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 14 | 0 | my ( $self ) = @_; | |
| 15 | 0 | $self->app->add_middleware(Plack::Middleware::Session->new( | |
| 16 | store => Plack::Session::Store::File->new | ||
| 17 | )); | ||
| 18 | 0 | ▶ | $self->app->register_function('session',sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 19 | 0 | $self->app->hash_accessor_empty($self->app->cc->env->{'psgix.session'},@_); | |
| 20 | 0 | }); | |
| 21 | 0 | ▶ | $self->app->register_function('session_has',sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 22 | 0 | $self->app->hash_accessor_has($self->app->cc->env->{'psgix.session'},@_); | |
| 23 | 0 | }); | |
| 24 | 0 | ▶ | $self->app->register_function('clear_session',sub { |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 25 | 0 | $self->app->cc->env->{'psgix.session'} = {}; | |
| 26 | 0 | }); | |
| 27 | } | ||
| 28 | |||
| 29 | 1 | 1; | |
| 30 | |||
| 31 | __END__ | ||