why does warm coke go flat

Warm water can hold less dissolved CO2 than cold water. Even if the CO2 is cold, however, the CO2 in the carbonated water will eventually escape if there is no CO2 in the air above it.