From: Tatsuhiko Miyagawa Date: Sat, 9 Jan 2010 20:04:22 +0000 (-0800) Subject: s/cleanup/remove/ in Store API X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FWeb-Session.git;a=commitdiff_plain;h=08b2e16d35e53b1c4ac4ec0e292cebc424f0c0eb s/cleanup/remove/ in Store API --- diff --git a/lib/Plack/Middleware/Session.pm b/lib/Plack/Middleware/Session.pm index 2d11bbc..1dbe441 100644 --- a/lib/Plack/Middleware/Session.pm +++ b/lib/Plack/Middleware/Session.pm @@ -87,7 +87,7 @@ sub generate_id { sub commit { my($self, $session, $options) = @_; if ($options->{expire}) { - $self->store->cleanup($options->{id}); + $self->store->remove($options->{id}); } else { $self->store->store($options->{id}, $session); } diff --git a/lib/Plack/Session/Store.pm b/lib/Plack/Session/Store.pm index 9753671..727ff42 100644 --- a/lib/Plack/Session/Store.pm +++ b/lib/Plack/Session/Store.pm @@ -23,7 +23,7 @@ sub store { $self->_stash->{ $session_id } = $session; } -sub cleanup { +sub remove { my ($self, $session_id) = @_; delete $self->_stash->{ $session_id } } @@ -92,7 +92,7 @@ store or delete multiple keys at a time. =over 4 -=item B +=item B This method is called by the L C method and is used to remove any session data. diff --git a/lib/Plack/Session/Store/Cache.pm b/lib/Plack/Session/Store/Cache.pm index 76f1c36..f7b6f9b 100644 --- a/lib/Plack/Session/Store/Cache.pm +++ b/lib/Plack/Session/Store/Cache.pm @@ -33,7 +33,7 @@ sub store { $self->cache->set($session_id => $session); } -sub cleanup { +sub remove { my ($self, $session_id) = @_; $self->cache->remove($session_id); } diff --git a/lib/Plack/Session/Store/File.pm b/lib/Plack/Session/Store/File.pm index 65ce648..6107529 100644 --- a/lib/Plack/Session/Store/File.pm +++ b/lib/Plack/Session/Store/File.pm @@ -44,7 +44,7 @@ sub store { $self->serializer->( $session, $file_path ); } -sub cleanup { +sub remove { my ($self, $session_id) = @_; unlink $self->_get_session_file_path( $session_id ); } diff --git a/lib/Plack/Session/Store/Null.pm b/lib/Plack/Session/Store/Null.pm index cded1ec..e49add1 100644 --- a/lib/Plack/Session/Store/Null.pm +++ b/lib/Plack/Session/Store/Null.pm @@ -8,7 +8,7 @@ our $AUTHORITY = 'cpan:STEVAN'; sub new { bless {} => shift } sub fetch {} sub store {} -sub cleanup {} +sub remove {} 1;