_tried_loading_session_data
_tried_loading_session_expires
_tried_loading_flash_data
+ _needs_early_session_finalization
/
);
# up to date. First call to session_expires will extend the expiry, subs
# just return the previously extended value.
$c->session_expires;
- $c->finalize_session;
+ $c->finalize_session if $c->_needs_early_session_finalization;
return $c->maybe::next::method(@_);
}
-sub _needs_early_session_finalization { 0 }
-
sub finalize_body {
my $c = shift;
# 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 unless $c->_needs_early_session_finalization;
$c->_clear_session_instance_data;
return $c->maybe::next::method(@_);