Women have long relied on cranberry juice or supplements to prevent painful urinary tract infections.