7 Catalyst::Plugin::Session::State::Stash - Maintain session IDs using the stash
15 use Catalyst qw/Session Session::State::Stash Session::Store::Foo/;
19 An alternative state storage plugin that allows you some more flexibility in
20 dealing with session storage. This plugin loads and saves the session ID from
27 =item delete_session_id
29 Deletes the session. Unfortunately I've been unable to squash a bug that will
30 stop you from opening a new session in the same execution, however.
35 Gets the current session id.
39 Sets the session id to the C<shift>.
41 =item get_session_expires
43 Gets when the current session expires.
45 =item set_session_expires
47 Sets how many seconds from now the session should expire.
51 =head1 EXTENDED METHODS
57 Loads the id off the stash.
61 Defaults the C<stash_key> parameter to C<_session>.
71 The name of the hash key to use. Defaults to C<_session>.
75 If present, splits C<stash_key> at this character to nest. E.g. a C<delim> of '/'
76 and C<stash_key> of '123/456' will store it as $c->stash->{123}->{456}
80 How long the session should last in seconds.
84 For example, you could stick this in F<MyApp.pm>:
86 __PACKAGE__->config( 'Plugin::Session' => {
87 stash_key => 'session_id',
92 You can't delete a session then create a new one. If this is important to you,
97 Manual work may be involved to make better use of this.
99 =for stopwords stateful
101 If you are writing a stateful web service with
102 L<Catalyst::Plugin::Server::XMLRPC>, you will probably only have to deal with
103 loading, as when saving, the ID will already be on the stash.
107 L<Catalyst>, L<Catalyst::Plugin::Session>, L<Catalyst::Plugin::Session::State>,
108 L<Catalyst::Plugin::Session::State::Cookie> (what you probably want).
112 James Laver <perl -e 'printf qw/%s@%s.com cpan jameslaver/'>
119 This module is derived from L<Catalyst::Plugin::Session::State::Cookie> code.
120 Thanks to anyone who wrote code for that.
123 Thanks to Kent Fredric for a patch for nested keys
127 =for stopwords Florian Ragwitz Karen Etheridge Tomas Doran James Laver
133 Florian Ragwitz <rafl@debian.org>
137 Karen Etheridge <ether@cpan.org>
141 Tomas Doran <bobtfish@bobtfish.net>
145 James Laver <jjl@baozi.local>
149 James Laver <james@jameslaver.com>
153 =head1 COPYRIGHT AND LICENSE
155 This software is copyright (c) 2009 by James Laver.
157 This is free software; you can redistribute it and/or modify it under
158 the same terms as the Perl 5 programming language system itself.