C::P::Session::State::Cookie - improved tests (cookie_secure option)
[catagits/Catalyst-Plugin-Session-State-Cookie.git] / t / lib / CookieTestApp.pm
1 package # Hide from PAUSE
2   CookieTestApp;
3 use Catalyst qw/
4   Session
5   Session::Store::Dummy
6   Session::State::Cookie
7   /;
8
9 __PACKAGE__->config->{session} = { cookie_secure => 2 };
10
11 sub page : Local {
12     my ( $self, $c ) = @_;
13     $c->res->body( "Hi! hit number " . ++$c->session->{counter} );
14 }
15
16 sub 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
23 sub 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
33 1;
34