Plack::Session - Middleware for session management
use Plack::Session; my $store = Plack::Session::Store->new; my $state = Plack::Session::State->new; my $s = Plack::Session->new( store => $store, state => $state, request => Plack::Request->new( $env ) ); # ...
This is the core session object, you probably want to look at Plack::Middleware::Session, unless you are writing your own session middleware component.
The constructor expects keys in %params for state, store and request. The request param is expected to be a Plack::Request instance or an object with an equivalent interface.
%params
This is the accessor for the session id.
This is expected to be a Plack::Session::State instance or an object with an equivalent interface.
This is expected to be a Plack::Session::Store instance or an object with an equivalent interface.
These methods delegate to appropriate methods on the store to manage your session data.
store
This method can be called to expire the current session id. It will call the cleanup method on the store and the finalize method on the state, passing both of them the session id and the $response.
cleanup
finalize
state
$response
This method should be called at the end of the response cycle. It will call the persist method on the store and the expire_session_id method on the state, passing both of them the session id. The $response is expected to be a Plack::Response instance or an object with an equivalent interface.
persist
expire_session_id
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.
Stevan Little <stevan.little@iinteractive.com>
Copyright 2009, 2010 Infinity Interactive, Inc.
http://www.iinteractive.com
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Plack::Middleware::Session, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::Session
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::Session
For more information on module installation, please visit the detailed CPAN module installation guide.