NAME

Amon2::Plugin::Web::HTTPSession - Plugin system for Amon2

SYNOPSIS

use Amon2::Lite;

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')
        );
    },
});

get '/' => sub {
    my $c = shift;

    my $foo = $c->session->get('foo');
    if ($foo) {
          $c->session->set('foo' => $foo+1);
    } else {
          $c->session->set('foo' => 1);
    }
};

DESCRIPTION

HTTP::Session integrate to Amon2.

After load this plugin, you can get instance of HTTP::Session from $c-session> method.

NOTE

I will remove this plugin from core distribution. If you want to use this plugin, add to prereq_pm.

SEE ALSO

HTTP::Session