Checking in changes prior to tagging of version 0.11. Changelog diff is:
[catagits/Catalyst-Plugin-Session-State-Cookie.git] / t / lib / CookieTestApp.pm
diff --git a/t/lib/CookieTestApp.pm b/t/lib/CookieTestApp.pm
new file mode 100644 (file)
index 0000000..62da412
--- /dev/null
@@ -0,0 +1,32 @@
+package # Hide from PAUSE
+  CookieTestApp;
+use Catalyst qw/
+  Session
+  Session::Store::Dummy
+  Session::State::Cookie
+  /;
+
+sub page : Local {
+    my ( $self, $c ) = @_;
+    $c->res->body( "Hi! hit number " . ++$c->session->{counter} );
+}
+
+sub stream : Local {
+    my ( $self, $c ) = @_;
+    my $count = ++$c->session->{counter};
+    $c->res->write("hit number ");
+    $c->res->write($count);
+}
+
+sub deleteme : Local {
+    my ( $self, $c ) = @_;
+    my $id = $c->get_session_id;
+    $c->delete_session;
+    my $id2 = $c->get_session_id;
+    $c->res->body( $id ne ( $id2 || '' ) );
+}
+
+__PACKAGE__->setup;
+
+1;
+