Added check for IdCache being disposed with active sessions.