A cucumber is a gourd that is usually stored cold in a fridge (in the West, anyway). Thus, to be "cool as a cucumber" is to be very cool; that is, level-headed, even-tempered, in strong command of oneself. Ex.: "You've already done one TV interview. You'll be cool as a cucumber in the next one!"