Catalyst::Plugin::Session::State::Cookie - Maintain session IDs using cookies.
use Catalyst qw/Session Session::State::Cookie Session::Store::Foo/;
In order for Catalyst::Plugin::Session to work the session ID needs to be stored on the client, and the session data needs to be stored on the server.
This plugin stores the session ID on the client using the cookie mechanism.
Returns a hash reference with the default values for new cookies.
Sets the cookie based on cookie_name in the response object.
cookie_name
Will restore if an appropriate cookie is found.
Will set a cookie called session if it doesn't exist or if it's value is not the current session id.
session
Will set the cookie_name parameter to it's default value if it isn't set.
The name of the cookie to store (defaults to Catalyst::Utils::apprefix($c) . '_session').
Catalyst::Utils::apprefix($c) . '_session'
The name of the domain to store in the cookie (defaults to current host)
Number of seconds from now you want to elapse before cookie will expire. Set to 0 to create a session cookie, ie one which will die when the user's browser is shut down.
If this attribute set true, the cookie will only be sent via HTTPS.
Sessions have to be created before the first write to be saved. For example:
sub action : Local { my ( $self, $c ) = @_; $c->res->write("foo"); $c->session( ... ); ... }
Will cause a session ID to not be set, because by the time a session is actually created the headers have already been sent to the client.
Catalyst, Catalyst::Plugin::Session.
This module is derived from Catalyst::Plugin::Session::FastMmap code, and has been heavily modified since.
Andrew Ford Andy Grundman Christian Hansen Yuval Kogman, nothingmuch@woobling.org Marcus Ramberg Sebastian Riedel
nothingmuch@woobling.org
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Plugin::Session::State::Cookie, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::Session::State::Cookie
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::Session::State::Cookie
For more information on module installation, please visit the detailed CPAN module installation guide.