More backend database stuff for active sessions