File Coverage

blib/lib/CGI/Session/ID/static.pm
Criterion Covered Total %
statement 15 16 93.7
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 21 24 87.5


line stmt bran cond sub pod time code
1             package CGI::Session::ID::static;
2 3     3   21 use base 'CGI::Session::ErrorHandler';
  3         7  
  3         385  
3              
4 3     3   19 use strict;
  3         7  
  3         127  
5 3     3   17 use Carp 'croak';
  3         7  
  3         144  
6 3     3   17 use CGI::Session::ErrorHandler;
  3         5  
  3         268  
7              
8             $CGI::Session::ID::static::VERSION = '4.44';
9              
10             sub generate_id {
11 2     2 0 3 my ($self, $args, $claimed_id ) = @_;
12 2 50       6 unless ( defined $claimed_id ) {
13 0         0 croak "'CGI::Session::ID::Static::generate_id()' requires static id";
14             }
15 2         6 return $claimed_id;
16             }
17              
18             1;
19             __END__
20              
21             =head1 NAME
22              
23             CGI::Session::ID::static - CGI::Session ID Driver for generating static IDs
24              
25             =head1 SYNOPSIS
26              
27             use CGI::Session;
28             $session = CGI::Session->new( 'driver:mysql;id:static', $ENV{REMOTE_ADDR}, { Handle => $dbh } );
29              
30             =head1 DESCRIPTION
31              
32             CGI::Session::ID::static is used to generate consistent, static session
33             ID's. In other words, you tell CGI::Session ID you want to use, and it will honor it.
34              
35             Unlike the other ID drivers, this one requires that you provide an ID when creating
36             the session object; if you pass it an undefined value, it will croak.
37              
38             =head1 COPYRIGHT
39              
40             Copyright (C) 2002 Adam Jacob <adam@sysadminsith.org>,
41              
42             This library is free software. You can modify and distribute it under the same
43             terms as Perl itself.
44              
45             =head1 AUTHORS
46              
47             Adam Jacob <adam@sysadminsith.org>,
48              
49             =head1 LICENSING
50              
51             For additional support and licensing see L<CGI::Session|CGI::Session>
52              
53             =cut