6 use HTTP::Request::Common;
13 plan skip_all => "Need Catalyst::Plugin::Session::State::Cookie"
14 unless do { local $@; eval { require Catalyst::Plugin::Session::State::Cookie; } };
17 use Catalyst::Test 'SessionTestApp';
20 ($res, $c) = ctx_request(POST 'http://localhost/login', [username => 'bob', password => 's00p3r', remember => 1]);
21 is($res->code, 200, 'succeeded');
22 my $cookie = $res->header('Set-Cookie');
23 ok($cookie, 'Have a cookie');
25 # this checks that cookie persists across a redirect
26 ($res, $c) = ctx_request(GET 'http://localhost/do_redirect', Cookie => $cookie);
27 is($res->code, 302, 'redirected');
28 is($res->header('Location'), 'http://localhost/page', 'Redirected after do_redirect');
29 ok($res->header('Set-Cookie'), 'Cookie is still there after redirect');