Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added plugin for Plack::Middleware::Session
- Loading branch information
1 parent
d1d62a4
commit de625e4
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |