Removing dangerous locks in setSession