File Coverage

blib/lib/Prancer/Session/Store/Memory.pm
Criterion Covered Total %
statement 12 15 80.0
branch 0 2 0.0
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 17 23 73.9


line stmt bran cond sub pod time code
1             package Prancer::Session::Store::Memory;
2              
3 4     4   3057 use strict;
  4         5  
  4         118  
4 4     4   9 use warnings FATAL => 'all';
  4         6  
  4         102  
5              
6 4     4   994 use Plack::Session::Store;
  4         909  
  4         102  
7 4     4   13 use parent qw(Plack::Session::Store);
  4         3  
  4         12  
8              
9             # this module does not require any additional settings
10             # we override the parent module strictly for semantics
11             # and maybe some day (but probably not) this module might be replaced by a
12             # different, homegrown version
13              
14             sub new {
15 0     0 1       my ($class, $config) = @_;
16 0 0             return bless($class->SUPER::new(%{$config || {}}), $class);
  0            
17             }
18              
19             1;
20              
21             =head1 NAME
22            
23             Prancer::Session::Store::Memory
24            
25             =head1 SYNOPSIS
26            
27             This module implements a session handler where all sessions are kept in memory.
28             This B<SHOULD NOT BE USED IN PRODUCTION>. If the server restarts all of your
29             users will be logged out. If you are using a multi-process server like Starman,
30             your users will be logged out whenever they connect to a different process so
31             basically every time they connect. This should be used strictly for testing.
32            
33             Though this will be the default session handler if none is configured, it can
34             be explicitly configured like this:
35            
36             session:
37             store:
38             driver: Prancer::Session::Store::Memory
39            
40             =cut
41