Whenever my almost 3yo DS has a bad cold and is full of snot and phlegm, he invariably vomits after getting up in the morning...
It's like the build up of phlegm has triggered some kind of sick reflex and it's his way of purging himself of the phlegm (since he isn't really able to cough it up or blow his nose yet).
He has no other gastric symptoms (suggesting it's not a tummy bug along with the cold).