Gold futures log first gain in 3 sessions