Added support for post-db-connect callback. Fixes session issues in many circumstances.