I agree with FamousLongAgo, this is a complicated setup and there's not enough information here to debug it. Show us the code...
Some general comments on Apache::Session:
I cannot find any help with the Apache::Session module, the docs don't have any kind of trouble shooting, and no site or list to get help.
The author supports that module on the apache-modperl mailing list.
Make sure you are updating something in the top level of the session hash, so Apache::Session will know that it has changed. The docs suggest putting a time stamp in the top level.
If you're using undef %session, try changing it to untie %session and vice versa. I don't know why this sometimes helps, but I've found that changing from one to the other can fix problems with session data not saving. The Apache::Session docs say you should undef or untie your session hash
as soon as you are done with it. I'd appreciate any comments on why undef or untie might behave differently.
Try wrapping your undef %session or untie %session and your database disconnect in an END{} block to make sure it happens in all cases. Your script may be exiting without executing that code because of an error or a forgotten exit() somewhere else.
Speaking of errors, you are running with strict and warnings turned on, right? Check the server error log and correct any errors from your script. I've found that error messages that seem totally unrelated to session handling can interfere with the saving of session data (usually by causing a premature exit, see above).