Amon2::Plugin::Web::HTTPSession - Plugin system for Amon2
package MyApp::Web; use parent qw/MyApp Amon2::Web/; use HTTP::Session::Store::Memcached; __PACKAGE__->load_plugins(qw/Web::HTTPSession/ => { state => 'URI', store => sub { my ($c) = @_; HTTP::Session::Store::Memcached->new( memd => $c->get('Cache::Memcached::Fast') ); }, }); package MyApp::C::Root; use strict; use warnings; sub index { my ($class, $c) = @_; my $foo = $c->session->get('foo'); if ($foo) { $c->session->set('foo' => $foo+1); } else { $c->session->set('foo' => 1); } }
HTTP::Session integrate to Amon2.
After load this plugin, you can get instance of HTTP::Session from $c-session> method.
$c-
HTTP::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.