fontardion has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I'm starting to learn Dancer web framework. One of the first things I'm testing is sessions. The sessions are created in the session folder, but every time I access to the web page, It creates a new one and the visits number doesn't increase.
My code is:
get '/usuario' => sub { my $number_visits; if ( not session('visits') ) { session visits => 1; $number_visits = 1; } else { $number_visits = int ( session('visits') ) + 1; session visits => $number_visits; } template 'user_get' => { num_of_visits => $number_visits, }; };
Can you see what I'm doing wrong?
Thank you
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dancer Sessions
by CountZero (Bishop) on Feb 28, 2011 at 13:44 UTC | |
|
Re: Dancer Sessions
by locked_user sundialsvc4 (Abbot) on Feb 28, 2011 at 20:16 UTC |