line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Session::State::URI; |
2
|
3
|
|
|
3
|
|
22869
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
112
|
|
3
|
3
|
|
|
3
|
|
1087
|
use HTTP::Session::State::Base; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
25
|
|
4
|
3
|
|
|
3
|
|
287
|
use HTML::StickyQuery; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
79
|
|
5
|
3
|
|
|
3
|
|
1981
|
use HTTP::Session::State::Mixin::ResponseFilter qw/response_filter/; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
1180
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_ro_accessors(qw/session_id_name/); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
6
|
|
|
6
|
1
|
59
|
my $class = shift; |
11
|
6
|
50
|
|
|
|
26
|
my %args = ref($_[0]) ? %{$_[0]} : @_; |
|
0
|
|
|
|
|
0
|
|
12
|
|
|
|
|
|
|
# set default values |
13
|
6
|
|
50
|
|
|
35
|
$args{session_id_name} ||= 'sid'; |
14
|
6
|
|
|
|
|
66
|
bless {%args}, $class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get_session_id { |
18
|
6
|
|
|
6
|
1
|
487
|
my ($self, $req) = @_; |
19
|
6
|
100
|
|
|
|
188
|
Carp::croak "missing req" unless $req; |
20
|
5
|
|
|
|
|
20
|
$req->param($self->session_id_name); # hmm... this is not support psgi. |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub html_filter { |
24
|
4
|
|
|
4
|
1
|
30
|
my ($self, $session_id, $html) = @_; |
25
|
4
|
50
|
|
|
|
13
|
Carp::croak "missing session_id" unless $session_id; |
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
|
|
15
|
my $session_id_name = $self->session_id_name; |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
42
|
$html =~ s{( |
30
|
|
|
|
|
|
|
|
31
|
4
|
|
|
|
|
28
|
my $sticky = HTML::StickyQuery->new; |
32
|
4
|
|
|
|
|
390
|
return $sticky->sticky( |
33
|
|
|
|
|
|
|
scalarref => \$html, |
34
|
|
|
|
|
|
|
param => { $session_id_name => $session_id }, |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub redirect_filter { |
39
|
3
|
|
|
3
|
1
|
13
|
my ( $self, $session_id, $path ) = @_; |
40
|
3
|
50
|
|
|
|
13
|
Carp::croak "missing session_id" unless $session_id; |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
22
|
my $uri = URI->new($path); |
43
|
3
|
|
|
|
|
10939
|
$uri->query_form( $uri->query_form, $self->session_id_name => $session_id ); |
44
|
3
|
|
|
|
|
462
|
return $uri->as_string; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |