fix Makefile.PL when no . in @INC
[catagits/Catalyst-Plugin-Session.git] / lib / Catalyst / Plugin / Session / State.pm
CommitLineData
9e447f9d 1#!/usr/bin/perl
2
3package Catalyst::Plugin::Session::State;
4
5use strict;
6use warnings;
7
9e447f9d 8__PACKAGE__;
9
10__END__
11
12=pod
13
14=head1 NAME
15
16Catalyst::Plugin::Session::State - Base class for session state
c80e9f04 17preservation plugins.
9e447f9d 18
19=head1 SYNOPSIS
20
45c0711b 21 package Catalyst::Plugin::Session::State::MyBackend;
22 use base qw/Catalyst::Plugin::Session::State/;
9e447f9d 23
24=head1 DESCRIPTION
25
c80e9f04 26This class doesn't actually provide any functionality, but when the
27C<Catalyst::Plugin::Session> module sets up it will check to see that
28C<< YourApp->isa("Catalyst::Plugin::Session::State") >>.
29
30When you write a session state plugin you should subclass this module this
31reason only.
32
33=head1 WRITING STATE PLUGINS
34
a92c8aeb 35To write a session state plugin you usually need to extend two methods:
c80e9f04 36
37=over 4
38
a92c8aeb 39=item prepare_(action|cookies|whatever)
c80e9f04 40
a92c8aeb 41Set C<sessionid> (accessor) at B<prepare> time using data in the request.
c80e9f04 42
a92c8aeb 43Note that this must happen B<before> other C<prepare_action> instances, in
44order to get along with L<Catalyst::Plugin::Session>. Overriding
45C<prepare_cookies> is probably the stablest approach.
c80e9f04 46
a92c8aeb 47=item finalize
48
49Modify the response at to include the session ID if C<sessionid> is defined,
50using whatever scheme you use. For example, set a cookie,
c80e9f04 51
52=back
53
9e447f9d 54=cut
55
56
c80e9f04 57
58
59