fix some typos and spelling mistakes
[catagits/Web-Session.git] / lib / Plack / Session / State / Cookie.pm
index 3ec6bb7..bb61a97 100644 (file)
@@ -2,7 +2,7 @@ package Plack::Session::State::Cookie;
 use strict;
 use warnings;
 
-our $VERSION   = '0.03';
+our $VERSION   = '0.11';
 our $AUTHORITY = 'cpan:STEVAN';
 
 use parent 'Plack::Session::State';
@@ -27,11 +27,12 @@ sub merge_options {
 
     delete $options{id};
 
-    $options{path}     = $self->path || '/' if !exists $options{path} && defined $self->path;
+    $options{path}     = $self->path || '/' if !exists $options{path};
     $options{domain}   = $self->domain      if !exists $options{domain} && defined $self->domain;
     $options{secure}   = $self->secure      if !exists $options{secure} && defined $self->secure;
     $options{httponly} = $self->httponly    if !exists $options{httponly} && defined $self->httponly;
 
+
     if (!exists $options{expires} && defined $self->expires) {
         $options{expires} = time + $self->expires;
     }
@@ -55,7 +56,7 @@ sub _set_cookie {
     my($self, $id, $res, %options) = @_;
 
     # TODO: Do not use Plack::Response
-    my $response = Plack::Response->new($res);
+    my $response = Plack::Response->new(@$res);
     $response->cookies->{ $self->session_key } = +{
         value => $id,
         %options,
@@ -91,7 +92,7 @@ Plack::Session::State::Cookie - Basic cookie-based session state
 
 =head1 DESCRIPTION
 
-This is a subclass of L<Plack::Session::State> and implements it's
+This is a subclass of L<Plack::Session::State> and implements its
 full interface. This is the default state used in
 L<Plack::Middleware::Session>.