Set session to expiration to 1 week and kill plain-text cookie once set

This commit is contained in:
swagg boi 2021-03-29 13:51:37 -04:00
parent c5b25dcc40
commit 392f55a791

View file

@ -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;