Catalyst-Plugin-Session-State-Stash-0.14
[catagits/Catalyst-Plugin-Session-State-Stash.git] / README.pod
CommitLineData
569c7126 1=pod
2
3=encoding UTF-8
4
5=head1 NAME
6
7Catalyst::Plugin::Session::State::Stash - Maintain session IDs using the stash
8
9=head1 VERSION
10
11version 0.14
12
13=head1 SYNOPSIS
14
15 use Catalyst qw/Session Session::State::Stash Session::Store::Foo/;
16
17=head1 DESCRIPTION
18
19An alternative state storage plugin that allows you some more flexibility in
20dealing with session storage. This plugin loads and saves the session ID from
21and to the stash.
22
23=head1 METHODS
24
25=over 4
26
27=item delete_session_id
28
29Deletes the session. Unfortunately I've been unable to squash a bug that will
30stop you from opening a new session in the same execution, however.
31Patches welcome!
32
33=item get_session_id
34
35Gets the current session id.
36
37=item set_session_id
38
39Sets the session id to the C<shift>.
40
41=item get_session_expires
42
43Gets when the current session expires.
44
45=item set_session_expires
46
47Sets how many seconds from now the session should expire.
48
49=back
50
51=head1 EXTENDED METHODS
52
53=over 4
54
55=item prepare_action
56
57Loads the id off the stash.
58
59=item setup_session
60
61Defaults the C<stash_key> parameter to C<_session>.
62
63=back
64
65=head1 CONFIGURATION
66
67=over 4
68
69=item stash_key
70
71The name of the hash key to use. Defaults to C<_session>.
72
73=item stash_delim
74
75If present, splits C<stash_key> at this character to nest. E.g. a C<delim> of '/'
76and C<stash_key> of '123/456' will store it as $c->stash->{123}->{456}
77
78=item expires
79
80How long the session should last in seconds.
81
82=back
83
84For example, you could stick this in F<MyApp.pm>:
85
86 __PACKAGE__->config( 'Plugin::Session' => {
87 stash_key => 'session_id',
88 });
89
90=head1 BUGS
91
92You can't delete a session then create a new one. If this is important to you,
93patches welcome!
94
95=head1 CAVEATS
96
97Manual work may be involved to make better use of this.
98
99=for stopwords stateful
100
101If you are writing a stateful web service with
102L<Catalyst::Plugin::Server::XMLRPC>, you will probably only have to deal with
103loading, as when saving, the ID will already be on the stash.
104
105=head1 SEE ALSO
106
107L<Catalyst>, L<Catalyst::Plugin::Session>, L<Catalyst::Plugin::Session::State>,
108L<Catalyst::Plugin::Session::State::Cookie> (what you probably want).
109
110=head1 AUTHOR
111
112James Laver <perl -e 'printf qw/%s@%s.com cpan jameslaver/'>
113
114=head1 CONTRIBUTORS
115
116=over 4
117
118=item *
119This module is derived from L<Catalyst::Plugin::Session::State::Cookie> code.
120Thanks to anyone who wrote code for that.
121
122=item *
123Thanks to Kent Fredric for a patch for nested keys
124
125=back
126
127=for stopwords Florian Ragwitz Karen Etheridge Tomas Doran James Laver
128
129=over 4
130
131=item *
132
133Florian Ragwitz <rafl@debian.org>
134
135=item *
136
137Karen Etheridge <ether@cpan.org>
138
139=item *
140
141Tomas Doran <bobtfish@bobtfish.net>
142
143=item *
144
145James Laver <jjl@baozi.local>
146
147=item *
148
149James Laver <james@jameslaver.com>
150
151=back
152
153=head1 COPYRIGHT AND LICENSE
154
155This software is copyright (c) 2009 by James Laver.
156
157This is free software; you can redistribute it and/or modify it under
158the same terms as the Perl 5 programming language system itself.
159
160=cut