X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FPlack%2FSession%2FStore.pm;h=fc9677db5a042110f33b65d6f2ed021d51451803;hb=98f62fd71971d0b21a90f840ef52ec7907432cf5;hp=38fc4d9f95b9ad46bf1c2f355da53b9be7319f4a;hpb=30cc0a719190fa26fb7b844d21db3237b8441db6;p=catagits%2FWeb-Session.git diff --git a/lib/Plack/Session/Store.pm b/lib/Plack/Session/Store.pm index 38fc4d9..fc9677d 100644 --- a/lib/Plack/Session/Store.pm +++ b/lib/Plack/Session/Store.pm @@ -2,7 +2,7 @@ package Plack::Session::Store; use strict; use warnings; -our $VERSION = '0.01'; +our $VERSION = '0.09_02'; our $AUTHORITY = 'cpan:STEVAN'; use Plack::Util::Accessor qw[ _stash ]; @@ -14,35 +14,20 @@ sub new { } sub fetch { - my ($self, $session_id, $key) = @_; - $self->_stash->{ $session_id }->{ $key } + my ($self, $session_id) = @_; + $self->_stash->{ $session_id }; } sub store { - my ($self, $session_id, $key, $data) = @_; - $self->_stash->{ $session_id }->{ $key } = $data; -} - -sub delete { - my ($self, $session_id, $key) = @_; - delete $self->_stash->{ $session_id }->{ $key }; + my ($self, $session_id, $session) = @_; + $self->_stash->{ $session_id } = $session; } -sub cleanup { +sub remove { my ($self, $session_id) = @_; delete $self->_stash->{ $session_id } } -sub persist { - my ($self, $session_id, $response) = @_; - () -} - -sub dump_session { - my ($self, $session_id) = @_; - $self->_stash->{ $session_id } || {}; -} - 1; __END__ @@ -92,16 +77,14 @@ No parameters are expected to this constructor. =head2 Session Data Management -These methods fetch data from the session storage. It can only fetch, -store or delete a single key at a time. +These methods fetch data from the session storage. It's designed to +store or delete multiple keys at a time. =over 4 -=item B - -=item B +=item B -=item B +=item B =back @@ -109,24 +92,11 @@ store or delete a single key at a time. =over 4 -=item B - -This method will perform any data persistence nessecary to maintain -data across requests. This method is called by the L -C method. The C<$response> is expected to be a L -instance or an object with an equivalent interface. - -=item B +=item B This method is called by the L C method and is used to remove any session data. -=item B - -This method is mostly for debugging purposes, it will always return -a HASH ref, even if no data is actually being stored (in which case -the HASH ref will be empty). - =back =head1 BUGS @@ -141,7 +111,7 @@ Stevan Little Estevan.little@iinteractive.comE =head1 COPYRIGHT AND LICENSE -Copyright 2009 Infinity Interactive, Inc. +Copyright 2009, 2010 Infinity Interactive, Inc. L