Logout now checks the Session stack appropriately.