| 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
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
| |||||||||||||||||||||
| 20 | 2191 | return $self->SUPER::store($c); | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 7 | 1; | |||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | __END__ | ||||||||||||||||||||