line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Catalyst::Plugin::Session::Store::Cache; |
4
|
1
|
|
|
1
|
|
25210
|
use base qw/Catalyst::Plugin::Session::Store/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
714
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
7
|
1
|
|
|
1
|
|
176
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
258
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $cache_key_prefix = "catalyst-plugin-session-store-cache:"; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub get_session_data { |
14
|
0
|
|
|
0
|
1
|
|
my ($c, $key) = @_; |
15
|
0
|
|
|
|
|
|
$c->cache->get($cache_key_prefix . $key); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub store_session_data { |
19
|
0
|
|
|
0
|
1
|
|
my ($c, $key, $data) = @_; |
20
|
0
|
|
|
|
|
|
my $expires = $c->config->{session}{expires}; |
21
|
0
|
|
|
|
|
|
$c->cache->set($cache_key_prefix . $key, $data, $expires); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub delete_session_data { |
25
|
0
|
|
|
0
|
1
|
|
my ( $c, $key ) = @_; |
26
|
0
|
|
|
|
|
|
$c->cache->remove($cache_key_prefix . $key); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
1
|
|
sub delete_expired_sessions { } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=pod |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 NAME |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
Catalyst::Plugin::Session::Store::Cache - Store sessions using a Catalyst::Plugin::Cache |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
use Catalyst qw/Cache::YourFavoriteCache Session Session::Store::Cache/; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 DESCRIPTION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This plugin will store your session data in whatever cache module you |
48
|
|
|
|
|
|
|
have configured. |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 METHODS |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
See L<Catalyst::Plugin::Session::Store>. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=over 4 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item get_session_data |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=item store_session_data |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item delete_session_data |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item delete_expired_sessions |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=back |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 AUTHOR |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Lars Balker Rasmussen, E<lt>lbr@cpan.orgE<gt> |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Copyright (C) 2007 by Lars Balker Rasmussen |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
75
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.8 or, |
76
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |