Skip to content

Commit

Permalink
added plugin for Plack::Middleware::Session
Browse files Browse the repository at this point in the history
  • Loading branch information
Craftworks committed Apr 7, 2014
1 parent d1d62a4 commit de625e4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/Kurious/Plugin/Plack/Middleware/Session.pm
@@ -0,0 +1,24 @@
package Kurious::Plugin::Plack::Middleware::Session;

use Kurious::Base 'Mojolicious::Plugin';

sub register {
my ($self, $app, $conf) = @_;

$app->helper('psgi_session' => sub {
my $c = shift;
return $c->req->env->{'psgix.session'};
});

$app->helper('psgi_session_change_id' => sub {
my $c = shift;
$c->req->env->{'psgix.session.options'}{'change_id'}++;
});

$app->helper('psgi_session_expire' => sub {
my $c = shift;
$c->req->env->{'psgix.session.options'}{'expire'}++;
});
}

1;

0 comments on commit de625e4

Please sign in to comment.