Change method of expiry timestamp storage in Session, and write only if necessary...
[catagits/Catalyst-Plugin-Session.git] / lib / Catalyst / Plugin / Session / Store / Dummy.pm
CommitLineData
300eb468 1#!/usr/bin/perl
2
3package Catalyst::Plugin::Session::Store::Dummy;
4use base qw/Catalyst::Plugin::Session::Store/;
5
6use strict;
7use warnings;
8
9my %store;
10
11sub get_session_data {
d44bc687 12 my ( $c, @keys ) = @_;
13 @store{@keys};
300eb468 14}
15
16sub store_session_data {
d44bc687 17 my $c = shift;
18 my %data = @_;
19
20 @store{ keys %data } = values %data;
300eb468 21}
22
23sub delete_session_data {
24 my ( $c, $sid ) = @_;
25 delete $store{$sid};
26}
27
28sub delete_expired_sessions { }
29
30__PACKAGE__;
31
32__END__
33
34=pod
35
36=head1 NAME
37
71666e00 38Catalyst::Plugin::Session::Store::Dummy - Doesn't really store sessions - useful for tests.
300eb468 39
40=head1 SYNOPSIS
41
71666e00 42 use Catalyst qw/Session Session::Store::Dummy/;
300eb468 43
44=head1 DESCRIPTION
45
71666e00 46This plugin will "store" data in a hash.
47
52ef8b23 48=head1 METHODS
49
50See L<Catalyst::Plugin::Session::Store>.
51
52=over 4
53
54=item get_session_data
55
56=item store_session_data
57
58=item delete_session_data
59
60=item delete_expired_sessions
61
62=back
63
300eb468 64=cut
65
66