Skip to content

Commit

Permalink
Add session management.
Browse files Browse the repository at this point in the history
  • Loading branch information
akzhan committed Jun 25, 2017
1 parent 7fafbc5 commit 1a70068
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/defaults.yml
Expand Up @@ -6,6 +6,8 @@ app:
port: 7777
workers: 1
backlog: 128
session:
expire: 2419200 # 4 weeks
database:
host: localhost
name: yourdatabase
Expand Down
8 changes: 8 additions & 0 deletions script/http.pl
Expand Up @@ -2,9 +2,17 @@

use Plack::Handler::Starman;
use Plack::Builder;
use Plack::Session::State::Cookie;
use Plack::Session::Store::RedisFast;

my $app = Plack::Util::load_psgi "./script/cli";

builder {
enable 'Session',
state => Plack::Session::State::Cookie->new(
expires => YourCompany::Config->app->{session}{lifetime} ),
store => Plack::Session::Store::RedisFast->new(
expires => YourCompany::Config->app->{session}{lifetime} );

$app;
};

0 comments on commit 1a70068

Please sign in to comment.