Revision history for Perl extension Catalyst::Plugin::Session
-0.012
+0.13
+ - add `clear_flash`
+ - improve debug logging
+
+0.12
- refactor out a hookable finalize_session method, for plugins
- make _clear_session_instance_data call NEXT::, so that plugins can
hook on to that too
sub finalize_session {
my $c = shift;
+ $c->NEXT::finalize_session;
+
$c->_save_session_id;
$c->_save_session;
$c->_save_flash;
$c->_save_session_expires;
$c->_clear_session_instance_data;
-
- $c->NEXT::finalize_session;
}
sub _save_session_id {
sub delete_session {
my ( $c, $msg ) = @_;
- $c->log->debug("Deleting session") if $c->debug;
+ $c->log->debug("Deleting session" . ( defined($msg) ? "($msg)" : '(no reason given)') ) if $c->debug;
# delete the session data
if ( my $sid = $c->sessionid ) {
}
}
+sub clear_flash {
+ my $c = shift;
+ $c->_flash_key_hashes({});
+ $c->_flash({});
+}
+
sub session_expire_key {
my ( $c, %keys ) = @_;
}
}
+=item clear_flash
+
+Zap all the keys in the flash regardless of their current state.
+
=item keep_flash @keys
If you wawnt to keep a flash key for the next request too, even if it hasn't