X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FPlack%2FSession%2FState.pm;h=10a13684921f4af2a404df7cd51887483afa719f;hb=3d92cf47c8b9eca07fcbf2bb856963f49c68228e;hp=440be4332610d5b85007d72ab38a9c52a4c56bc0;hpb=01fb49064ecd29f290b9e81f0b23a034780f52ef;p=catagits%2FWeb-Session.git diff --git a/lib/Plack/Session/State.pm b/lib/Plack/Session/State.pm index 440be43..10a1368 100644 --- a/lib/Plack/Session/State.pm +++ b/lib/Plack/Session/State.pm @@ -70,21 +70,52 @@ __END__ Plack::Session::State - Basic parameter-based session state +=head1 SYNOPSIS + + use Plack::Builder; + use Plack::Middleware::Session; + use Plack::Session::State; + + my $app = sub { + return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Foo' ] ]; + }; + + builder { + enable 'Session', + state => Plack::Session::State->new; + $app; + }; + =head1 DESCRIPTION +This will maintain session state by passing the session through +the request params. It does not do this automatically though, +you are responsible for passing the session param. + +This should be considered the state "base" class (although +subclassing is not a requirement) and defines the spec for +all B modules. You will only +need to override a couple methods if you do subclass. See +L for an example of this. + =head1 METHODS =over 4 =item B +The C<%params> can include I and I, +however in both cases a default will be provided for you. + =item B This is the name of the session key, it default to 'plack_session'. =item B -This is a CODE ref used to generate unique session ids. +This is a CODE ref used to generate unique session ids, by default +it will generate a SHA1 using fairly sufficient entropy. If you are +concerned or interested, just read the source. =back