X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FSession.pm;h=e9c2a13572ca2c6b41c9302c797be5321446cf69;hb=2842d93853af927a543214ccbe17d659f5ecd181;hp=8b66e786a684534a96a2e60ee515b0106122fd3a;hpb=eb250519802344a677c86103e5bba640dc40d59f;p=catagits%2FCatalyst-Plugin-Session.git diff --git a/lib/Catalyst/Plugin/Session.pm b/lib/Catalyst/Plugin/Session.pm index 8b66e78..e9c2a13 100644 --- a/lib/Catalyst/Plugin/Session.pm +++ b/lib/Catalyst/Plugin/Session.pm @@ -13,7 +13,7 @@ use overload (); use Object::Signature (); use Carp; -our $VERSION = '0.20'; +our $VERSION = '0.19_01'; my @session_data_accessors; # used in delete_session BEGIN { @@ -98,13 +98,15 @@ sub finalize_headers { return $c->NEXT::finalize_headers(@_); } -sub finalize { +sub finalize_body { my $c = shift; - my $ret = $c->NEXT::finalize(@_); - # then finish the rest + # We have to finalize our session *before* $c->engine->finalize_xxx is called, + # because we do not want to send the HTTP response before the session is stored/committed to + # the session database (or whatever Session::Store you use). $c->finalize_session; - return $ret; + + return $c->NEXT::finalize_body(@_); } sub finalize_session { @@ -764,10 +766,10 @@ prepare time. This method is extended and will extend the expiry time before sending the response. -=item finalize +=item finalize_body -This method is extended and will call finalize_session after the other -finalizes run. Here we persist the session data if a session exists. +This method is extended and will call finalize_session before the other +finalize_body methods run. Here we persist the session data if a session exists. =item initialize_session_data @@ -1010,10 +1012,14 @@ Andy Grundman Christian Hansen -Yuval Kogman, C (current maintainer) +Yuval Kogman, C Sebastian Riedel +Tomas Doran (t0m) C (current maintainer) + +Sergio Salvi + And countless other contributers from #catalyst. Thanks guys! =head1 COPYRIGHT & LICENSE