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 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 our $VERSION = '0.023.1';
7  
8 7 ▶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 2191 ▶sub store {
Subroutine store: called CC=2 SCAR=7.6
Pod documented
18 2191 my ($self, $c) = @_;
19 2191 ▶ local $self->{secure} = $self->{secure} || $c->req->is_secure;
Condition33%1/3
$self->{'secure'} || $c->req->is_secure
l!l&&r!l&&!r
002191
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 2191 return $self->SUPER::store($c);
21 }
22  
23 7 1;
24  
25 __END__
« blib/lib/Database/BI/Tutorial.pm ↑ Summary blib/lib/Database/BI/I18N/en_us.pm »