view release on metacpan or search on metacpan
- Allow specifying table for Oracle
- Use Test::Database for tests
1.89 2010-09-22 by Alexandr Ciornii
- require Digest::MD5
- all semaphore tests were removed
- Apache::Session::Store::File::materialize should not append to $session->{serialized}
- Apache::Session::Store::File will flush after writing to file
1.88 2008-12-20 by Alexandr Ciornii
- Apache::Session::Generate::MD5::validate will untaint data
- MIN_PERL_VERSION in Makefile.PL
1.87=1.86_03 2008-08-08
1.86_03 2008-08-03 by Alexandr Ciornii
- disabled 99semaphore.t. Help needed.
1.86_02 2008-06-27 by Alexandr Ciornii
- correct number of tests in 99semaphore.t
1.86_01 2008-06-20 by Alexandr Ciornii
- more info in die message in Apache::Session::Generate::MD5 (RT#36412, by Knut Arne Bjorndal)
- semaphore tests check for semctl availability
- Makefile.PL prints message if perl version < 5.006
1.86 2008-02-01 by Alexandr Ciornii
- Default number of semaphores for *BSD is 8 in Apache::Session::Lock::Semaphore
1.85_01 2008-01-24 by Alexandr Ciornii
- typos corrected (catched by Gerald Fox)
- more tests and diag in 99semaphore.t
- no warning "disconnect invalidates 2 active statement" in
Apache::Session::Lock::MySQL by Tony Cook (RT#32148)
1.85 2007-12-20 by Alexandr Ciornii, Perl 20th birthday version
- mention Catalyst::Plugin::Session, Session
1.84_01 2007-11-26 by Alexandr Ciornii (alexchorny AT gmail.com)
- Added Apache::Session::Lock::Semaphore::remove to remove semaphore
- 99flex.t will remove semaphore (RT#30440)
- 99flex.t should work on 5.6.1 again (no chdir now)
- 99flex.t will clean all temporary files (RT#30209)
without tests.
Informix support from Mike Langen <mike.langen AT tamedia.ch>. Unfortunately no
tests were included.
Changes in 1.54 (2001-10-11):
Added mod_uniqueid and mod_usertrack generators from
Tatsuhiko Miyagawa <miyagawa AT bulknews.net>
Fixed validate function in Flex.
Move to Digest::MD5 instead of MD5.
Changes in 1.53 (2000-09-01):
?
Changes in 1.52 (2000-07-23):
Chris Winters <cwinters AT intes.net> added the Sybase backing store and
lib/Apache/Session.pm view on Meta::CPAN
#get the session id for later use
my $id = $session{_session_id};
#...time passes...
#get the session data back out again during some other request
my %session;
tie %session, 'Apache::Session::MySQL', $id;
validate($session{visa_number});
#delete a session from the object store permanently
tied(%session)->delete;
=head1 DESCRIPTION
Apache::Session is a persistence framework which is particularly useful
for tracking session data between httpd requests. Apache::Session is
designed to work with Apache and mod_perl, but it should work under
lib/Apache/Session.pm view on Meta::CPAN
#If a session ID was passed in, this is an old hash.
#If not, it is a fresh one.
if (defined $session_id && $session_id) {
#check the session ID for remote exploitation attempts
#this will die() on suspicious session IDs.
&{$self->{validate}}($self);
if (exists $args->{Transaction} && $args->{Transaction}) {
$self->acquire_write_lock;
}
$self->{status} &= ($self->{status} ^ NEW);
$self->restore;
}
else {
$self->{status} |= NEW;
lib/Apache/Session/DB_File.pm view on Meta::CPAN
use Apache::Session::Store::DB_File;
use Apache::Session::Generate::MD5;
use Apache::Session::Serialize::Storable;
sub populate {
my $self = shift;
$self->{object_store} = Apache::Session::Store::DB_File->new($self);
$self->{lock_manager} = Apache::Session::Lock::File->new($self);
$self->{generate} = \&Apache::Session::Generate::MD5::generate;
$self->{validate} = \&Apache::Session::Generate::MD5::validate;
$self->{serialize} = \&Apache::Session::Serialize::Storable::serialize;
$self->{unserialize} = \&Apache::Session::Serialize::Storable::unserialize;
return $self;
}
1;
=pod
lib/Apache/Session/File.pm view on Meta::CPAN
use Apache::Session::Store::File;
use Apache::Session::Generate::MD5;
use Apache::Session::Serialize::Storable;
sub populate {
my $self = shift;
$self->{object_store} = Apache::Session::Store::File->new($self);
$self->{lock_manager} = Apache::Session::Lock::File->new($self);
$self->{generate} = \&Apache::Session::Generate::MD5::generate;
$self->{validate} = \&Apache::Session::Generate::MD5::validate;
$self->{serialize} = \&Apache::Session::Serialize::Storable::serialize;
$self->{unserialize} = \&Apache::Session::Serialize::Storable::unserialize;
return $self;
}
sub DESTROY {
my $self = shift;
$self->save;
lib/Apache/Session/Flex.pm view on Meta::CPAN
my $lock = "Apache::Session::Lock::$self->{args}->{Lock}";
my $gen = "Apache::Session::Generate::$self->{args}->{Generate}";
my $ser = "Apache::Session::Serialize::$self->{args}->{Serialize}";
for my $class ($store, $lock) {
unless ($class->can('new')) {
eval "require $class" || die $@;
}
}
unless ($gen->can('validate')) {
eval "require $gen" || die $@;
}
unless ($ser->can('serialize')) {
eval "require $ser" || die $@;
}
$self->{object_store} = new $store $self;
$self->{lock_manager} = new $lock $self;
{
no strict 'refs';
$self->{generate} = \&{$gen . '::generate'};
$self->{validate} = \&{$gen . '::validate'};
$self->{serialize} = \&{$ser . '::serialize'};
$self->{unserialize} = \&{$ser . '::unserialize'};
}
return $self;
}
1;
=pod
lib/Apache/Session/Generate/MD5.pm view on Meta::CPAN
if (exists $session->{args}->{IDLength}) {
$length = $session->{args}->{IDLength};
}
$session->{data}->{_session_id} =
substr(Digest::MD5::md5_hex(Digest::MD5::md5_hex(time(). {}. rand(). $$)), 0, $length);
}
sub validate {
#This routine checks to ensure that the session ID is in the form
#we expect. This must be called before we start diddling around
#in the database or the disk.
my $session = shift;
if ($session->{data}->{_session_id} =~ /^([a-fA-F0-9]+)$/) {
$session->{data}->{_session_id} = $1;
} else {
die "Invalid session ID: ".$session->{data}->{_session_id};
lib/Apache/Session/Generate/ModUniqueId.pm view on Meta::CPAN
sub generate {
my $session = shift;
unless (exists $ENV{UNIQUE_ID}) {
require Carp;
Carp::croak('Can\'t get UNIQUE_ID env variable. Make sure mod_unique_id is enabled.');
}
$session->{data}->{_session_id} = $ENV{UNIQUE_ID};
}
sub validate {
my $session = shift;
$session->{data}->{_session_id} =~ /^[A-Za-z0-9@\-]+$/
or die "invalid session id: $session->{data}->{_session_id}.";
}
1;
__END__
=head1 NAME
lib/Apache/Session/Generate/ModUsertrack.pm view on Meta::CPAN
}
unless ($cookies{$name}) {
# still bad luck
require Carp;
Carp::croak('no cookie found. Make sure mod_usertrack is enabled.');
}
$session->{data}->{_session_id} = $cookies{$name}->value;
}
sub validate {
my $session = shift;
# remote_host (or remote_addr) + int
$session->{data}->{_session_id} =~ /^[\d\w\.]+\.\d+$/
or die "invalid session id: $session->{data}->{_session_id}";
}
1;
__END__
lib/Apache/Session/Informix.pm view on Meta::CPAN
use Apache::Session::Store::Informix;
use Apache::Session::Generate::MD5;
use Apache::Session::Serialize::Base64;
sub populate {
my $self = shift;
$self->{object_store} = Apache::Session::Store::Informix->new($self);
$self->{lock_manager} = Apache::Session::Lock::Null->new($self);
$self->{generate} = \&Apache::Session::Generate::MD5::generate;
$self->{validate} = \&Apache::Session::Generate::MD5::validate;
$self->{serialize} = \&Apache::Session::Serialize::Base64::serialize;
$self->{unserialize} = \&Apache::Session::Serialize::Base64::unserialize;
return $self;
}
1;
=pod
lib/Apache/Session/MySQL.pm view on Meta::CPAN
use Apache::Session::Store::MySQL;
use Apache::Session::Generate::MD5;
use Apache::Session::Serialize::Storable;
sub populate {
my $self = shift;
$self->{object_store} = new Apache::Session::Store::MySQL $self;
$self->{lock_manager} = new Apache::Session::Lock::MySQL $self;
$self->{generate} = \&Apache::Session::Generate::MD5::generate;
$self->{validate} = \&Apache::Session::Generate::MD5::validate;
$self->{serialize} = \&Apache::Session::Serialize::Storable::serialize;
$self->{unserialize} = \&Apache::Session::Serialize::Storable::unserialize;
return $self;
}
1;
=pod
lib/Apache/Session/MySQL/NoLock.pm view on Meta::CPAN
use Apache::Session::Store::MySQL;
use Apache::Session::Generate::MD5;
use Apache::Session::Serialize::Storable;
sub populate {
my $self = shift;
$self->{object_store} = Apache::Session::Store::MySQL->new($self);
$self->{lock_manager} = Apache::Session::Lock::Null->new($self);
$self->{generate} = \&Apache::Session::Generate::MD5::generate;
$self->{validate} = \&Apache::Session::Generate::MD5::validate;
$self->{serialize} = \&Apache::Session::Serialize::Storable::serialize;
$self->{unserialize} = \&Apache::Session::Serialize::Storable::unserialize;
return $self;
}
1;
=pod
lib/Apache/Session/Oracle.pm view on Meta::CPAN
use Apache::Session::Store::Oracle;
use Apache::Session::Generate::MD5;
use Apache::Session::Serialize::Base64;
sub populate {
my $self = shift;
$self->{object_store} = new Apache::Session::Store::Oracle $self;
$self->{lock_manager} = new Apache::Session::Lock::Null $self;
$self->{generate} = \&Apache::Session::Generate::MD5::generate;
$self->{validate} = \&Apache::Session::Generate::MD5::validate;
$self->{serialize} = \&Apache::Session::Serialize::Base64::serialize;
$self->{unserialize} = \&Apache::Session::Serialize::Base64::unserialize;
return $self;
}
1;
=pod
lib/Apache/Session/Postgres.pm view on Meta::CPAN
use Apache::Session::Store::Postgres;
use Apache::Session::Generate::MD5;
use Apache::Session::Serialize::Base64;
sub populate {
my $self = shift;
$self->{object_store} = new Apache::Session::Store::Postgres $self;
$self->{lock_manager} = new Apache::Session::Lock::Null $self;
$self->{generate} = \&Apache::Session::Generate::MD5::generate;
$self->{validate} = \&Apache::Session::Generate::MD5::validate;
$self->{serialize} = \&Apache::Session::Serialize::Base64::serialize;
$self->{unserialize} = \&Apache::Session::Serialize::Base64::unserialize;
return $self;
}
1;
=pod
lib/Apache/Session/Sybase.pm view on Meta::CPAN
$VERSION = '1.00';
@ISA = qw( Apache::Session );
sub populate {
my $self = shift;
$self->{object_store} = new Apache::Session::Store::Sybase $self;
$self->{lock_manager} = new Apache::Session::Lock::Null $self;
$self->{generate} = \&Apache::Session::Generate::MD5::generate;
$self->{validate} = \&Apache::Session::Generate::MD5::validate;
$self->{serialize} = \&Apache::Session::Serialize::Sybase::serialize;
$self->{unserialize} = \&Apache::Session::Serialize::Sybase::unserialize;
return $self;
}
1;
=pod
}
{
package Apache::Session::Generate::Test;
# This wack double assignment prevents "... used only once"
# warnings.
*Apache::Session::Generate::Test::generate =
*Apache::Session::Generate::Test::generate =
\&Apache::Session::Generate::MD5::generate;
*Apache::Session::Generate::Test::validate =
*Apache::Session::Generate::Test::validate =
\&Apache::Session::Generate::MD5::validate;
}
{
package Apache::Session::Serialize::Test;
*Apache::Session::Serialize::Test::serialize =
*Apache::Session::Serialize::Test::serialize =
\&Apache::Session::Serialize::Storable::serialize;
*Apache::Session::Serialize::Test::unserialize =
*Apache::Session::Serialize::Test::unserialize =