Safer returning of segment cookie value

Instead of just returning the segment cookie value, check against the
condition names which were defined in the A/B test and return that
condition name.