Amon2::Plugin::Web::PlackSession - Plack::Session integration for Amon2
use Amon2::Lite; use Plack::Builder; get '/' => sub { my $c = shift; my $cnt = $c->session->get('cnt') || 0; $c->session->set( 'cnt', ++$cnt ); return $c->create_response( 200, [ 'Content-Type' => 'text/plain', 'Content-Length' => length($cnt) ], [$cnt] ); }; builder { enable 'Session'; MyApp::Web->to_app(); };
This module is glue for Amon2 and Plack::Session.
This module provides $c->session method. It returns instance of Plack::Session.
$c->session
Plack::Session
To install Amon2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amon2
CPAN shell
perl -MCPAN -e shell install Amon2
For more information on module installation, please visit the detailed CPAN module installation guide.