lib/CPAN/lib/CGI/Session/ID/static.pm
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
colas@0
     1
package CGI::Session::ID::static;
colas@0
     2
colas@0
     3
# $Id: static.pm 351 2006-11-24 14:16:50Z markstos $
colas@0
     4
colas@0
     5
use strict;
colas@0
     6
use Carp ("croak");
colas@0
     7
use CGI::Session::ErrorHandler;
colas@0
     8
colas@0
     9
$CGI::Session::ID::static::VERSION = '4.20';
colas@0
    10
@::CGI::Session::ID::static::ISA   = qw( CGI::Session::ErrorHandler );
colas@0
    11
colas@0
    12
sub generate_id {
colas@0
    13
    my ($self, $args, $claimed_id ) = @_;
colas@0
    14
    unless ( defined $claimed_id ) {
colas@0
    15
        croak "'CGI::Session::ID::Static::generate_id()' requires static id";
colas@0
    16
    }
colas@0
    17
    return $claimed_id;
colas@0
    18
}
colas@0
    19
colas@0
    20
1;
colas@0
    21
__END__
colas@0
    22
colas@0
    23
=head1 NAME
colas@0
    24
colas@0
    25
CGI::Session::ID::static - CGI::Session ID Driver for generating static IDs
colas@0
    26
colas@0
    27
=head1 SYNOPSIS
colas@0
    28
colas@0
    29
    use CGI::Session;
colas@0
    30
    $session = new CGI::Session("id:static", $ENV{REMOTE_ADDR});
colas@0
    31
colas@0
    32
=head1 DESCRIPTION
colas@0
    33
colas@0
    34
CGI::Session::ID::static is used to generate consistent, static session
colas@0
    35
ID's. In other words, you tell CGI::Session ID you want to use, and it will honor it.
colas@0
    36
colas@0
    37
Unlike the other ID drivers, this one requires that you provide an ID when creating
colas@0
    38
the session object; if you pass it an undefined value, it will croak.
colas@0
    39
colas@0
    40
=head1 COPYRIGHT
colas@0
    41
colas@0
    42
Copyright (C) 2002 Adam Jacob <adam@sysadminsith.org>,
colas@0
    43
colas@0
    44
This library is free software. You can modify and distribute it under the same
colas@0
    45
terms as Perl itself.
colas@0
    46
colas@0
    47
=head1 AUTHORS
colas@0
    48
colas@0
    49
Adam Jacob <adam@sysadminsith.org>,
colas@0
    50
colas@0
    51
=head1 LICENSING
colas@0
    52
colas@0
    53
For additional support and licensing see L<CGI::Session|CGI::Session>
colas@0
    54
colas@0
    55
=cut