I get asked this question all the time, so I'm here to answer!
If you feel a cold coming on and the symptoms you are experiencing are all above your neck, then it's okay to do a little bit of light cardio to work up a sweat and get your blood flowing. You don't want to push it too hard though, your body is already doing a lot to fight the bug you caught.
If your symptoms are below your neck such as body aches, chills, or weakness, then definitely go home and REST. You need to let your body use its energy to heal and get you better. During this time of rest focus on eating well and properly nourishing your body so that you can stay on track with your fitness goals.
Overall, the best advice that I can give you is to LISTEN TO YOUR BODY. By that I mean that if you are feeling weak and tired and just want to go lay in bed, then do it! Your body is telling you that it needs to spend its energy on healing you, so rest up!