Set session to expiration to 1 week and kill plain-text cookie once set
This commit is contained in:
parent
c5b25dcc40
commit
392f55a791
|
@ -19,7 +19,10 @@ under sub {
|
|||
my ($c) = @_;
|
||||
|
||||
if ($c->cookie('banner') eq 'seen') {
|
||||
$c->session->{banner} //= 'seen'
|
||||
# Set session for a week
|
||||
$c->session(expiration => 604800)->{banner} //= 'seen';
|
||||
# Kill plain-text cookie
|
||||
$c->cookie(banner => 'seen', {expires => 1});
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Reference in a new issue