2 use Plack::Middleware::Session;
4 use HTTP::Request::Common;
10 isa_ok($env->{'plack.session'}, 't::MyCustomSession');
12 my $counter = $env->{'plack.session'}->get('counter') || 0;
14 my $body = "Counter=$counter";
16 $env->{'plack.session'}->set(counter => $counter);
18 return [ 200, [], [ $body ] ];
21 $app = Plack::Middleware::Session->wrap(
23 session_class => 't::MyCustomSession'
29 my $jar = HTTP::Cookies->new;
31 my $res = $cb->(GET "http://localhost/");
32 is $res->content, "Counter=0";
33 $jar->extract_cookies($res);
35 my $req = GET "http://localhost/";
36 $jar->add_cookie_header($req);
38 is $res->content, "Counter=1";