Checking in changes prior to tagging of version 0.10. Changelog diff is:
[catagits/Web-Session.git] / lib / Plack / Session.pm
index e6a1c91..949f480 100644 (file)
@@ -2,15 +2,13 @@ package Plack::Session;
 use strict;
 use warnings;
 
-our $VERSION   = '0.03';
+our $VERSION   = '0.10';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use Plack::Util::Accessor qw( session options );
 
 sub new {
     my ($class, $env) = @_;
-    # NOTE: when you make a subclass, be sure to NEVER save $env in
-    # your hash. That will create a circular reference.
     bless {
         session => $env->{'psgix.session'},
         options => $env->{'psgix.session.options'},
@@ -74,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);