Revision history for Perl extension Catalyst::Plugin::Session
-0.03
+0.04 2005-12-28 09:42:00
+ - Work around a limitation in Cache::FastMmap - must store only
+ references, while expiration was an NV.
+
+0.03 2005-12-26 10:22:00
- Lazify loading of session data for better performance and less chance
of race conditions
- support for $c->flash a la Ruby on Rails
# all sessions are extended at the end of the request
my $now = time;
- $c->store_session_data(
- "expires:$sid" => ( $c->config->{session}{expires} + $now ) );
+
+ # the ref is a workaround for FastMmap:
+ # FastMmap can't store values which aren't refs
+ # this yields errors and other great suckage
+ $c->store_session_data( "expires:$sid" =>
+ ( { expires => $c->config->{session}{expires} + $now } ) );
no warnings 'uninitialized';
if ( Object::Signature::signature($session_data) ne
if ( my $sid = $c->_sessionid ) {
no warnings 'uninitialized'; # ne __address
- my $session_expires = $c->get_session_data("expires:$sid") || 0;
+ # see above for explanation of the workaround for FastMmap problem
+ my $session_expires =
+ ( $c->get_session_data("expires:$sid") || { expires => 0 } )
+ ->{expires};
if ( $session_expires < time ) {