Hi-
I've created an object interface to Apache::Session. It's a simple
module that I've called Apache::Session::Object (seemed pretty
intuitive) that presents the following interface:
# Create new session using the default File store
use Apache::Session::Object;
my $session = new Apache::Session::Object;
my $id = $session->session_id; # get session_id
$session->{visa_number} = "4441 2001 2039 1100";
$session->param('visa_number') = "4441 2001 2039 1100"; # same
# Open existing session in the DB_File store
use Apache::Session::Object;
my $session2 = new Apache::Session::Object
($id, {Store => 'DB_File', Transaction => 1});
print $session2->_session_id; # leading _ ok
# yet another way to skin the same cat
$session->visa_number("4441 2001 2039 1100");
print $session2->visa_number;
Any comments on this? I wanted to write it to make a more consistent
interface with the other modules. It might also make sense to integrate
this with the existing Apache::Session module. The module itself is
pretty simple, just playing some tricks with new() and AUTOLOAD() to
provide a virtual OOP interface.
Thanks,
Nate