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