lib/CPAN/lib/CGI/Session/ID/static.pm
changeset 0 414e01d06fd5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lib/CPAN/lib/CGI/Session/ID/static.pm	Sat Jan 26 15:50:53 2008 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +package CGI::Session::ID::static;
     1.5 +
     1.6 +# $Id: static.pm 351 2006-11-24 14:16:50Z markstos $
     1.7 +
     1.8 +use strict;
     1.9 +use Carp ("croak");
    1.10 +use CGI::Session::ErrorHandler;
    1.11 +
    1.12 +$CGI::Session::ID::static::VERSION = '4.20';
    1.13 +@::CGI::Session::ID::static::ISA   = qw( CGI::Session::ErrorHandler );
    1.14 +
    1.15 +sub generate_id {
    1.16 +    my ($self, $args, $claimed_id ) = @_;
    1.17 +    unless ( defined $claimed_id ) {
    1.18 +        croak "'CGI::Session::ID::Static::generate_id()' requires static id";
    1.19 +    }
    1.20 +    return $claimed_id;
    1.21 +}
    1.22 +
    1.23 +1;
    1.24 +__END__
    1.25 +
    1.26 +=head1 NAME
    1.27 +
    1.28 +CGI::Session::ID::static - CGI::Session ID Driver for generating static IDs
    1.29 +
    1.30 +=head1 SYNOPSIS
    1.31 +
    1.32 +    use CGI::Session;
    1.33 +    $session = new CGI::Session("id:static", $ENV{REMOTE_ADDR});
    1.34 +
    1.35 +=head1 DESCRIPTION
    1.36 +
    1.37 +CGI::Session::ID::static is used to generate consistent, static session
    1.38 +ID's. In other words, you tell CGI::Session ID you want to use, and it will honor it.
    1.39 +
    1.40 +Unlike the other ID drivers, this one requires that you provide an ID when creating
    1.41 +the session object; if you pass it an undefined value, it will croak.
    1.42 +
    1.43 +=head1 COPYRIGHT
    1.44 +
    1.45 +Copyright (C) 2002 Adam Jacob <adam@sysadminsith.org>,
    1.46 +
    1.47 +This library is free software. You can modify and distribute it under the same
    1.48 +terms as Perl itself.
    1.49 +
    1.50 +=head1 AUTHORS
    1.51 +
    1.52 +Adam Jacob <adam@sysadminsith.org>,
    1.53 +
    1.54 +=head1 LICENSING
    1.55 +
    1.56 +For additional support and licensing see L<CGI::Session|CGI::Session>
    1.57 +
    1.58 +=cut