9 eval { require Catalyst::Plugin::Session::State::Cookie; Catalyst::Plugin::Session::State::Cookie->VERSION(0.03) }
11 "Catalyst::Plugin::Session::State::Cookie 0.03 or higher is required for this test";
14 require Test::WWW::Mechanize::Catalyst;
15 Test::WWW::Mechanize::Catalyst->VERSION(0.51);
18 'Test::WWW::Mechanize::Catalyst >= 0.51 is required for this test';
24 use Test::WWW::Mechanize::Catalyst "SessionTestApp";
26 # Test without delete __address
27 local $ENV{REMOTE_ADDR} = "192.168.1.1";
29 my $ua = Test::WWW::Mechanize::Catalyst->new( {} );
30 $ua->get_ok( "http://localhost/login" );
31 $ua->content_contains('logged in');
33 $ua->get_ok( "http://localhost/set_session_variable/logged/in" );
34 $ua->content_contains('session variable set');
38 local $ENV{REMOTE_ADDR} = "192.168.1.2";
40 $ua->get_ok( "http://localhost/get_session_variable/logged");
41 $ua->content_contains('VAR_logged=n.a.');
44 local $ENV{REMOTE_ADDR} = "192.168.1.1";
46 $ua->get_ok( "http://localhost/login_without_address" );
47 $ua->content_contains('logged in (without address)');
49 $ua->get_ok( "http://localhost/set_session_variable/logged/in" );
50 $ua->content_contains('session variable set');
53 local $ENV{REMOTE_ADDR} = "192.168.1.2";
55 $ua->get_ok( "http://localhost/get_session_variable/logged" );
56 $ua->content_contains('VAR_logged=in');