use strict;
use warnings;
-use Scalar::Util qw/blessed/;
+our $VERSION = '0.14';
+our $AUTHORITY = 'cpan:STEVAN';
+
+use Scalar::Util qw[ blessed ];
use parent 'Plack::Session::Store';
}
sub fetch {
- my ($self, $session_id, $key) = @_;
- my $cache = $self->cache->get($session_id);
- return unless $cache;
- return $cache->{ $key };
+ my ($self, $session_id ) = @_;
+ $self->cache->get($session_id);
}
sub store {
- my ($self, $session_id, $key, $data) = @_;
- my $cache = $self->cache->get($session_id);
- if ( !$cache ) {
- $cache = {$key => $data};
- }
- else {
- $cache->{$key} = $data;
- }
- $self->cache->set($session_id => $cache);
-}
-
-sub delete {
- my ($self, $session_id, $key) = @_;
- my $cache = $self->cache->get($session_id);
- return unless exists $cache->{$key};
-
- delete $cache->{ $key };
- $self->cache->set($session_id => $cache);
+ my ($self, $session_id, $session) = @_;
+ $self->cache->set($session_id => $session);
}
-sub cleanup {
+sub remove {
my ($self, $session_id) = @_;
$self->cache->remove($session_id);
}
-sub dump_session {
- my ($self, $session_id) = @_;
- $self->cache->get( $session_id ) || {};
-}
-
1;
__END__
excellent L<Cache>, L<Cache::Cache> and L<CHI> drivers available.
This is a subclass of L<Plack::Session::Store> and implements
-it's full interface.
+its full interface.
=head1 METHODS