Apache-Session

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

  Bavo De Ridder <bavo@ace.ulyssis.student.kuleuven.ac.be>
  Jules Bean <jmlb2@hermes.cam.ac.uk>
  Lincoln Stein <lstein@cshl.org>
  
Scott McWhirter <scott@surreytech.co.uk> contributed verbose error messages for
file locking.

Corris Randall <corris@line6.net> gave us the option to use any table name in
the MySQL store.

Oliver Maul <oliver.maul@ixos.de> updated the Sybase modules

Innumerable users sent a patch for the reversed file age test in the file
locking module.

Mike Langen <mike.langen@tamedia.ch> contributed Informix modules.

FURTHER INFORMATION:
--------------------

Apache   by Apache Group    comp.infosystems.www.servers.unix

lib/Apache/Session.pm  view on Meta::CPAN

lock on the session.

As you put data into the session hash, Session squirrels it away for
later use.  When you untie() the session hash, or it passes out of
scope, Session checks to see if anything has changed. If so, Session 
gains an exclusive lock and writes the session to the data store.  
It then releases any locks it has acquired.  

Note that Apache::Session does only a shallow check to see if anything has
changed.  If nothing changes in the top level tied hash, the data will not be
updated in the backing store.  You are encouraged to timestamp the session hash
so that it is sure to be updated.

When you call the delete() method on the session object, the
object is immediately removed from the object store, if possible.

When Session encounters an error, it calls die().  You will probably 
want to wrap your session logic in an eval block to trap these errors.

=head1 LOCKING AND TRANSACTIONS

By default, most Apache::Session implementations only do locking to prevent

lib/Apache/Session.pm  view on Meta::CPAN

  Lincoln Stein <lstein@cshl.org>

Jamie LeTaul <jletual@kmtechnologies.com> fixed file locking on Windows.

Scott McWhirter <scott@surreytech.co.uk> contributed verbose error messages for
file locking.

Corris Randall <corris@line6.net> gave us the option to use any table name in
the MySQL store.

Oliver Maul <oliver.maul@ixos.de> updated the Sybase modules

Innumerable users sent a patch for the reversed file age test in the file
locking module.

Langen Mike <mike.langen@tamedia.ch> contributed Informix modules.

=cut

package Apache::Session;

t/99dbfilestore.t  view on Meta::CPAN

my $new_serial = 'hi';
$session->{serialized} = $new_serial;
my $u_ret = $store->update($session);
is( $u_ret, $new_serial, "update() returned value of new serialized" );

undef $store;

my %hash;
tie %hash, 'DB_File', $dbfile;

is( $hash{$id}, $new_serial, "dbm file updated correctly" );

$store = $package->new;
isa_ok $store, $package;
$store->remove($session);

dies_ok {
    $store->materialize($session);
} "Can't materialize removed session";

undef $store;



( run in 0.338 second using v1.01-cache-2.11-cpan-05444aca049 )