From fe739e7f2bcff4c38caa63f656c20c9417b8e5ab Mon Sep 17 00:00:00 2001 From: swag Date: Mon, 4 Apr 2022 13:48:31 -0400 Subject: [PATCH] I should've been using 'expires' for the session rather than 'expiration' --- guestbook-ng.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/guestbook-ng.pl b/guestbook-ng.pl index a3174fa..a337cbb 100755 --- a/guestbook-ng.pl +++ b/guestbook-ng.pl @@ -43,10 +43,14 @@ under sub ($c) { unless ($c->session('counted')) { $c->counter->increment_visitor_count(); $c->session( - expiration => 3600, - counted => 1 + expires => time() + 3600, + counted => 1 ); } + # Delete this since I was supposed to be using 'expires' instead + # of 'expiration'; the difference is outlined here: + # https://docs.mojolicious.org/Mojolicious/Controller#session + delete $c->session('expiration') if $c->session('expiration'); $c->stash(status => 403) if $c->flash('error');