Fix sessionTimeoutExpiredOrMissing, rearrange else ifs