X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-Session-State-Cookie.git;a=blobdiff_plain;f=README;h=3fdd2dbcbad4b94db8cccb15109dc159599ff489;hp=daaceeeea967dd42e1639bb83aa518fd51234bea;hb=bab1512d7270f7f38f63a54ebe0677f27e9172b5;hpb=bf2bce672ebec6c0122d133aa86c325e2173c30c diff --git a/README b/README index daaceee..3fdd2db 100644 --- a/README +++ b/README @@ -1,29 +1,92 @@ NAME - Catalyst::Plugin::Session::FastMmap - FastMmap sessions for Catalyst + Catalyst::Plugin::Session::State::Cookie - Maintain session IDs using + cookies. SYNOPSIS - use Catalyst 'Session::FastMmap'; - - $c->session->{foo} = 'bar'; - print $c->sessionid; + use Catalyst qw/Session Session::State::Cookie Session::Store::Foo/; DESCRIPTION - EXTENDED METHODS - finalize - prepare_action - setup - METHODS - session - uri - Extends an uri with session id if needed. + 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. + +METHODS + make_session_cookie + Returns a hash reference with the default values for new cookies. + + update_session_cookie $hash_ref + Sets the cookie based on "cookie_name" in the response object. + + calc_expiry + calculate_session_cookie_expires + cookie_is_rejecting + delete_session_id + extend_session_id + get_session_cookie + get_session_id + set_session_id + +EXTENDED METHODS + prepare_cookies + Will restore if an appropriate cookie is found. + + finalize_cookies + Will set a cookie called "session" if it doesn't exist or if it's + value is not the current session id. + + setup_session + Will set the "cookie_name" parameter to it's default value if it + isn't set. + +CONFIGURATION + cookie_name + The name of the cookie to store (defaults to + "Catalyst::Utils::apprefix($c) . '_session'"). - my $uri = $c->uri('http://localhost/foo'); + cookie_domain + The name of the domain to store in the cookie (defaults to current + host) + + cookie_expires + 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. + + cookie_secure + If this attribute set true, the cookie will only be sent via HTTPS. + + cookie_path + The path of the request url where cookie should be baked. + +CAVEATS + 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. SEE ALSO - Catalyst. + Catalyst, Catalyst::Plugin::Session. + +AUTHORS + Yuval Kogman + +CONTRIBUTORS + This module is derived from Catalyst::Plugin::Session::FastMmap code, + and has been heavily modified since. -AUTHOR - Sebastian Riedel, "sri@cpan.org" + Andrew Ford Andy Grundman Christian Hansen Marcus Ramberg Jonathan + Rockway Sebastian Riedel COPYRIGHT This program is free software, you can redistribute it and/or modify it