Branch Coverage

blib/lib/CGI/Application/Plugin/Session.pm
Criterion Covered Total %
branch 55 78 70.5


line true false branch
32 21 42 unless ($$self{'__CAP__SESSION_OBJ'})
34 1 20 unless $$self{'__CAP__SESSION_CONFIG'}
39 20 1 $$self{'__CAP__SESSION_CONFIG'}{'CGI_SESSION_OPTIONS'} ? :
45 0 21 if (&Scalar::Util::blessed($params[1]) and not $params[1]->isa('CGI'))
53 6 15 unless ($$self{'__CAP__SESSION_OBJ'})
59 8 7 if ($$self{'__CAP__SESSION_CONFIG'}{'DEFAULT_EXPIRY'} and $$self{'__CAP__SESSION_OBJ'}->is_new)
68 13 2 if (not defined $$self{'__CAP__SESSION_CONFIG'}{'SEND_COOKIE'} or $$self{'__CAP__SESSION_CONFIG'}{'SEND_COOKIE'})
72 0 0 if (not $cid or $cid ne $$self{'__CAP__SESSION_OBJ'}->id or $$self{'__CAP__SESSION_OBJ'}->expire)
84 25 1 if (@_)
85 2 23 if defined $$self{'__CAP__SESSION_OBJ'}
87 8 15 if (ref $_[0] eq 'HASH') { }
94 21 2 if ($$props{'CGI_SESSION_OPTIONS'})
95 1 20 if ref $$props{'CGI_SESSION_OPTIONS'} ne 'ARRAY'
100 10 12 if ($$props{'COOKIE_PARAMS'})
101 1 9 if ref $$props{'COOKIE_PARAMS'} ne 'HASH'
106 10 11 if (defined $$props{'SEND_COOKIE'})
107 8 2 delete $$props{'SEND_COOKIE'} ? :
111 10 11 if (defined $$props{'DEFAULT_EXPIRY'})
116 1 20 if %$props
127 8 6 if ($$self{'__CAP__SESSION_CONFIG'}{'COOKIE_PARAMS'})
131 1 13 unless ($$self{'__CAP__SESSION_OBJ'})
138 1 13 if (exists $options{'-name'} and $options{'-name'} ne $self->session->name)
147 3 11 if (defined $self->session->expires and not defined $options{'-expires'})
155 3 11 if (my $cookies = $headers{'-cookie'})
156 1 2 if (ref $cookies eq 'ARRAY') { }
1 1 elsif (substr($cookies, 0, length $options{'-name'}) eq $options{'-name'}) { }
160 1 1 if (substr($$cookies[$i], 0, length $options{'-name'}) eq $options{'-name'})
172 12 2 unless $cookie_set
179 0 3 unless defined $secs_until_expiry
182 3 0 $secs_until_expiry >= 0 ? :
191 0 0 if (my $session = $self->session)
194 0 0 if ($$self{'__CAP__SESSION_CONFIG'}{'SEND_COOKIE'})
196 0 0 if ($$self{'__CAP__SESSION_CONFIG'}{'COOKIE_PARAMS'})
211 0 0 unless ref $cookies eq 'ARRAY'
213 0 0 if (ref $cookie ne 'CGI::Cookie' or $cookie->name ne $session->name)
226 0 0 if @keep
241 0 0 if (session_loaded($self))
253 0 0 if index($k, '_SESSION_') == 0
268 0 0 if ($sess_opts and $$sess_opts[4] and ref $$sess_opts[4] eq 'HASH' and exists $$sess_opts[4]{'name'})