[Catalyst-commits] r11684 - in Catalyst-Plugin-Session/0.00/trunk: . lib/Catalyst/Plugin t

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Thu Oct 29 09:50:54 GMT 2009


Author: t0m
Date: 2009-10-29 09:50:54 +0000 (Thu, 29 Oct 2009)
New Revision: 11684

Modified:
   Catalyst-Plugin-Session/0.00/trunk/Changes
   Catalyst-Plugin-Session/0.00/trunk/lib/Catalyst/Plugin/Session.pm
   Catalyst-Plugin-Session/0.00/trunk/t/live_session_fixation.t
Log:
Fix session fixation tests, kentnl++

Modified: Catalyst-Plugin-Session/0.00/trunk/Changes
===================================================================
--- Catalyst-Plugin-Session/0.00/trunk/Changes	2009-10-29 02:26:27 UTC (rev 11683)
+++ Catalyst-Plugin-Session/0.00/trunk/Changes	2009-10-29 09:50:54 UTC (rev 11684)
@@ -1,5 +1,9 @@
 Revision history for Perl extension Catalyst::Plugin::Session
 
+0.28 2009-10-29
+        - Fix session fixation test with LWP 5.833 by calling $cookie_jar->set_cookie
+          rather than manually stuffing the cookie in the request.
+
 0.27 2009-10-08
         - Release 0.26_01 as stable without further changes.
 

Modified: Catalyst-Plugin-Session/0.00/trunk/lib/Catalyst/Plugin/Session.pm
===================================================================
--- Catalyst-Plugin-Session/0.00/trunk/lib/Catalyst/Plugin/Session.pm	2009-10-29 02:26:27 UTC (rev 11683)
+++ Catalyst-Plugin-Session/0.00/trunk/lib/Catalyst/Plugin/Session.pm	2009-10-29 09:50:54 UTC (rev 11684)
@@ -13,7 +13,7 @@
 
 use namespace::clean -except => 'meta';
 
-our $VERSION = '0.27';
+our $VERSION = '0.28';
 $VERSION = eval $VERSION;
 
 my @session_data_accessors; # used in delete_session
@@ -1104,6 +1104,10 @@
 
 kmx C<kmx at volny.cz>
 
+Florian Ragwitz (rafl) C<rafl at debian.org>
+
+Kent Fredric (kentnl)
+
 And countless other contributers from #catalyst. Thanks guys!
 
 =head1 COPYRIGHT & LICENSE

Modified: Catalyst-Plugin-Session/0.00/trunk/t/live_session_fixation.t
===================================================================
--- Catalyst-Plugin-Session/0.00/trunk/t/live_session_fixation.t	2009-10-29 02:26:27 UTC (rev 11683)
+++ Catalyst-Plugin-Session/0.00/trunk/t/live_session_fixation.t	2009-10-29 09:50:54 UTC (rev 11684)
@@ -25,16 +25,19 @@
 use Test::WWW::Mechanize::Catalyst "SessionTestApp";
 
 #try completely random cookie unknown for our application; should be rejected
-my $injected_cookie = "sessiontestapp_session=89c3a019866af6f5a305e10189fbb23df3f4772c";
+my $cookie_name = 'sessiontestapp_session';
+my $cookie_value = '89c3a019866af6f5a305e10189fbb23df3f4772c';
+my ( @injected_cookie ) = ( 1, $cookie_name , $cookie_value ,'/', undef, 0, undef, undef, undef, {} );
+my $injected_cookie_str = "${cookie_name}=${cookie_value}";
 
 my $ua1 = Test::WWW::Mechanize::Catalyst->new;
-$ua1->add_header('Cookie' => $injected_cookie);
+$ua1->cookie_jar->set_cookie( @injected_cookie );
 
 my $res = $ua1->get( "http://localhost/login" );
 my $cookie1 = $res->header('Set-Cookie');
 
 ok $cookie1, "Set-Cookie 1";
-isnt $cookie1, qr/$injected_cookie/, "Logging in generates us a new cookie";
+isnt $cookie1, qr/$injected_cookie_str/, "Logging in generates us a new cookie";
 
 $ua1->get( "http://localhost/get_sessid" );
 my $sid1 = $ua1->content;
@@ -78,7 +81,7 @@
 
 #try to use old cookie value (before session_id_change)
 my $ua2 = Test::WWW::Mechanize::Catalyst->new;
-$ua2->add_header('Cookie' => $cookie1);
+$ua2->cookie_jar->set_cookie( @injected_cookie );
 
 #if we take old cookie we should not be able to get any old session data
 $ua2->get( "http://localhost/get_session_variable/var1");




More information about the Catalyst-commits mailing list