#!/usr/bin/perl -w
package FlashTestApp;
-use Catalyst qw/Session Session::Store::File Session::State::Cookie/;
+use Catalyst qw/Session Session::Store::Dummy Session::State::Cookie/;
use strict;
use warnings;
+no warnings 'uninitialized';
sub default : Private {
my ($self, $c) = @_;
my ( $self, $c ) = @_;
if ( ! $c->flash->{is_set}) {
$c->stash->{message} = "flash is not set";
- $c->stash->{is_set} = 1;
+ $c->flash->{is_set} = 1;
}
}
my ( $self, $c ) = @_;
if ($c->flash->{is_set} == 2) {
$c->stash->{message} = "flash set second time";
- $c->flash->{is_set} = 2;
+ $c->keep_flash("is_set");
}
}
$c->forward('/first');
}
-sub end : Local {
+sub end : Private {
my ($self, $c) = @_;
$c->res->output($c->stash->{message});
}