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