Octavian Rasnita wrote:
I am trying to use Apache::Session with mod_perl because I heard that it is
a little faster than CGI::Session.

This used to be true, but CGI::Session is under new management and has been improving.

The problem is that I cannot save
variables in the created sessions. They are created, but no data is saved.

That usually indicates that your session is not going out of scope and thus never getting DESTORYed, which is when it gets saved.

#Create session:
my %session;
eval {
tie(%session, 'Apache::Session::MySQL', undef, {Handle => $dbh, LockHandle
=> $dbh});
};

You need to check $@ here.  That may not succeed.

undef %session;

This should work, unless you have put the session in some other place (an object, a closure, a global) that is still in scope.

You can turn on DBI tracing to see if it's making any database contact. See DBI_TRACE in the DBI man page.

- Perrin

Reply via email to