Correct Session close logic.