blib/lib/Database/BI/Sessions.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 83.3% 20 / 24 CC 2 SCAR 3.8
CC
2
Cov
88%
store
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« blib/lib/Database/BI/Tutorial.pm ↑ Summary blib/lib/Database/BI/I18N/en_us.pm »
1 package Database::BI::Sessions;
2  
3 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 12 our $VERSION = '0.024.0';
7  
8 12 ▶use Mojo::Base 'Mojolicious::Sessions';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # The login cookie is marked Secure on a reply to a request that came over
11 # https, so the browser never sends it back over http, where anyone on the
12 # path could read it and log in as the reader. Mojolicious::Sessions has one secure
13 # setting for the whole application; a server reached both ways (or a proxy
14 # that says X-Forwarded-Proto: https) needs it per request. Over plain http
15 # the cookie cannot be Secure, or the browser would drop it and the login
16 # would never stick.
17 3301 ▶sub store {
Subroutine store: called CC=2 SCAR=7.6
Pod documented
18 3301 my ($self, $c) = @_;
19 3301 ▶ local $self->{secure} = $self->{secure} || $c->req->is_secure;
Condition33%1/3
$self->{'secure'} || $c->req->is_secure
l!l&&r!l&&!r
003301
MC/DC0%0/2
$self->{'secure'} || $c->req->is_secure
$self->{'secure'} $c->req->is_secure
Truth table33%1/3
A || B
A= $self->{'secure'}B= $c->req->is_secure
ABresult
1X1
011
000
20 3301 return $self->SUPER::store($c);
21 }
22  
23 12 1;
24  
25 __END__
« blib/lib/Database/BI/Tutorial.pm ↑ Summary blib/lib/Database/BI/I18N/en_us.pm »