line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Apache::Session::Generate::ModUniqueId; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1939
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
4
|
1
|
|
|
1
|
|
6
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
301
|
|
5
|
|
|
|
|
|
|
$VERSION = '0.01'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub generate { |
8
|
1
|
|
|
1
|
0
|
665
|
my $session = shift; |
9
|
1
|
50
|
|
|
|
6
|
unless (exists $ENV{UNIQUE_ID}) { |
10
|
0
|
|
|
|
|
0
|
require Carp; |
11
|
0
|
|
|
|
|
0
|
Carp::croak 'Can\'t get UNIQUE_ID env variable. Make sure mod_unique_id is enabled.'; |
12
|
|
|
|
|
|
|
} |
13
|
1
|
|
|
|
|
5
|
$session->{data}->{_session_id} = $ENV{UNIQUE_ID}; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub validate { |
17
|
0
|
|
|
0
|
0
|
|
my $session = shift; |
18
|
0
|
0
|
|
|
|
|
$session->{data}->{_session_id} =~ /^[A-Za-z0-9@\-]+$/ |
19
|
|
|
|
|
|
|
or die "invalid session id: $session->{data}->{_session_id}."; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
23
|
|
|
|
|
|
|
__END__ |