| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package CGI::Session::Plugin::Redirect; |
|
2
|
1
|
|
|
1
|
|
25247
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
35
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
159
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.01'; |
|
5
|
|
|
|
|
|
|
sub CGI::Session::redirect { |
|
6
|
0
|
|
|
0
|
0
|
|
my $session = shift; |
|
7
|
0
|
|
|
|
|
|
my($url,$param) = split(/\?/,shift,2); |
|
8
|
0
|
|
|
|
|
|
my $q = new CGI($param); |
|
9
|
0
|
|
|
|
|
|
$q->param($session->name => $session->id); |
|
10
|
0
|
|
|
|
|
|
return $q->redirect(-uri => "$url?".$q->query_string ,@_); |
|
11
|
|
|
|
|
|
|
} |
|
12
|
|
|
|
|
|
|
1; |
|
13
|
|
|
|
|
|
|
=pod |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
CGI::Session::Plugin::redirect - extended redirect method for CGI::Session |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
use CGI::Session; |
|
22
|
|
|
|
|
|
|
use CGI::Session::Plugin::Redirect; |
|
23
|
|
|
|
|
|
|
my $session = new CGI::Session(); |
|
24
|
|
|
|
|
|
|
print $session->redirect('http://exsample.com/redirect-path/'); |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
redirect() method is added to CGI::Session. |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 AUTHOR |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Shin Honda (makoto[at]cpan.org,makoto[at]cpan.jp) |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 copyright |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Copyright (c) 2006- Shin Honda. All rights reserved. |
|
37
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
|
38
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
L |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |