use strict;
use warnings;
-our $VERSION = '0.03';
+our $VERSION = '0.09_02';
our $AUTHORITY = 'cpan:STEVAN';
use Plack::Util;
use Plack::Util::Accessor qw(
state
store
- session_class
);
sub prepare_app {
$self->state( 'Cookie' ) unless $self->state;
$self->state( $self->inflate_backend('Plack::Session::State', $self->state) );
$self->store( $self->inflate_backend('Plack::Session::Store', $self->store) );
-
- Plack::Util::load_class($self->session_class) if $self->session_class;
}
sub inflate_backend {
$env->{'psgix.session.options'} = { id => $id };
- if ($self->session_class) {
- $env->{'plack.session'} = $self->session_class->new($env);
- }
-
my $res = $self->app->($env);
$self->response_cb($res, sub { $self->finalize($env, $_[0]) });
}
B<NOTE:> As of version 0.04 the session is stored in C<psgix.session>
instead of C<plack.session>.
-Also, if you set I<session_class> option (see below), we create a
-session object out of the hash reference in C<plack.session>.
-
=head2 State
=over 4
more robust solution see L<Plack::Session::Store::File> or
L<Plack::Session::Store::Cache>.
-=item I<session_class>
-
-This can be used to create an actual session object in
-C<plack.session> environment. Defaults to none, which means the
-session object is not created but you can set C<Plack::Session> to
-create an object for you.
-
=back
=head1 BUGS