Checking in changes prior to tagging of version 0.14.
[catagits/Web-Session.git] / lib / Plack / Session.pm
index 17a7a3a..dff6672 100644 (file)
@@ -2,15 +2,14 @@ package Plack::Session;
 use strict;
 use warnings;
 
-our $VERSION   = '0.03';
+our $VERSION   = '0.14';
 our $AUTHORITY = 'cpan:STEVAN';
 
-use Plack::Util::Accessor qw( manager session options );
+use Plack::Util::Accessor qw( session options );
 
 sub new {
-    my ($class, $env, $manager ) = @_;
+    my ($class, $env) = @_;
     bless {
-        manager => $manager,
         session => $env->{'psgix.session'},
         options => $env->{'psgix.session.options'},
     }, $class;
@@ -60,12 +59,6 @@ sub expire {
     $self->options->{expire} = 1;
 }
 
-sub commit {
-    my $self = shift;
-    $self->options->{no_store} = 1;
-    $self->manager->commit($self->_data, $self->options);
-}
-
 1;
 
 __END__
@@ -79,11 +72,13 @@ Plack::Session - Middleware for session management
 =head1 SYNOPSIS
 
   # Use with Middleware::Session
-  enable "Session", session_class => "Plack::Session";
+  enable "Session";
 
+  # later in your app
+  use Plack::Session;
   my $app = sub {
       my $env = shift;
-      my $session = $env->{'plack.session'}; # not psgix.
+      my $session = Plack::Session->new($env);
 
       $session->id;
       $session->get($key);
@@ -92,7 +87,6 @@ Plack::Session - Middleware for session management
       $session->keys;
 
       $session->expire;
-      $session->commit;
   };
 
 =head1 DESCRIPTION
@@ -105,10 +99,9 @@ own session middleware component.
 
 =over 4
 
-=item B<new ( $env, $mw )>
+=item B<new ( $env )>
 
-The constructor takes a PSGI request env hash reference and
-Plack::Middleware::Session facade object.
+The constructor takes a PSGI request env hash reference.
 
 =item B<id>
 
@@ -119,8 +112,7 @@ This is the accessor for the session id.
 =head2 Session Data Management
 
 These methods allows you to read and write the session data like
-Perl's normal hash. The operation is not synced to the storage until
-you call C<finalize> on it.
+Perl's normal hash.
 
 =over 4
 
@@ -140,11 +132,6 @@ you call C<finalize> on it.
 
 =over 4
 
-=item B<commit>
-
-This method synchronizes the session data to the data store, without
-waiting for the response final phase.
-
 =item B<expire>
 
 This method can be called to expire the current session id.