Update version in Build.PL
[catagits/Catalyst-Plugin-Session-State-Cookie.git] / lib / Catalyst / Plugin / Session / State / Cookie.pm
index 7f08b29..7fbde70 100644 (file)
@@ -7,7 +7,7 @@ use warnings;
 use NEXT;
 use Catalyst::Utils ();
 
-our $VERSION = "0.02";
+our $VERSION = "0.04";
 
 sub setup_session {
     my $c = shift;
@@ -48,8 +48,8 @@ sub make_session_cookie {
     my $cfg    = $c->config->{session};
     my $cookie = {
         value => $sid,
-        %attrs,
         ( $cfg->{cookie_domain} ? ( domain => $cfg->{cookie_domain} ) : () ),
+        %attrs,
     };
 
     unless ( exists $cookie->{expires} ) {
@@ -107,9 +107,11 @@ sub get_session_id {
 }
 
 sub delete_session_id {
-    my $c = shift;
-    $c->NEXT::delete_session_id();
-    delete $c->response->cookies->{ $c->config->{session}{cookie_name} };
+    my ( $c, $sid ) = @_;
+
+    $c->update_session_cookie( $c->make_session_cookie( $sid, expires => 0 ) );
+
+    $c->NEXT::delete_session_id($sid);
 }
 
 __PACKAGE__