some quick hacks to try and delay connecting to the sessions database until necessary
fixup