We've had this happen to us several times with our three year old son. This was a huge problem for us, particularly around 1-2 years old. Josh got used to being in bed with us and loved it so much that he wanted to repeat that... every night. To remedy the situation, we started off by sleeping in his room and sneaking out when he finally fell asleep. That worked for about a week but then we couldn't take it anymore and were exhausted. We had to explain to him that he sleeps in his own bed and mommy and daddy sleep in theirs. If anything happens, he can call us, we will come and comfort him but everyone has to sleep in their own bed. He didn't quite understand this or agree with it so after trying a number of different things (like moving slowly out of his room every night, telling him we'll come back in a few minutes, etc.) we just had to let him cry it out. Now that he's three, he gets it. If he's sick and stuffed up, he's absolutely miserable so we sleep in his room. After a day or two he typically gets used to it and asks us to stay and we explain that we cannot. He wines for a few minutes and then goes to sleep perfectly fine on his own, or he just accepts it and asks for an extra hug or kiss. Lately he doesn't even ask us to stay with him. Once he's better, he just goes to bed on his own, without any issues. (It took us a LOT of work to get here!!)
Now, this is all fine and dandy if your child is fine - i.e., the cold is over, he's breathing normally and there isn't anything else bothering him. For your child, is there anything else that would cause him to wake up screaming? Anything traumatic that happened recently? Is he teething? Is the weather changing and giving him headaches? If there's something else going on, you have to "suck it up" and comfort him. If he's just trying to manipulate you into staying with him because he loves the closeness (who doesn't!), then you have to stand your ground. Good luck!!!