Commit | Line | Data |
602b9593 |
1 | package # Hide from PAUSE |
2 | CookieTestApp; |
3 | use Catalyst qw/ |
4 | Session |
5 | Session::Store::Dummy |
6 | Session::State::Cookie |
7 | /; |
8 | |
9 | sub page : Local { |
10 | my ( $self, $c ) = @_; |
11 | $c->res->body( "Hi! hit number " . ++$c->session->{counter} ); |
12 | } |
13 | |
14 | sub stream : Local { |
15 | my ( $self, $c ) = @_; |
16 | my $count = ++$c->session->{counter}; |
17 | $c->res->write("hit number "); |
18 | $c->res->write($count); |
19 | } |
20 | |
21 | sub deleteme : Local { |
22 | my ( $self, $c ) = @_; |
23 | my $id = $c->get_session_id; |
24 | $c->delete_session; |
25 | my $id2 = $c->get_session_id; |
26 | $c->res->body( $id ne ( $id2 || '' ) ); |
27 | } |
28 | |
29 | __PACKAGE__->setup; |
30 | |
31 | 1; |
32 | |