When you have a cold, it's normal for you to get eyes hurt.
First, you'll have inflammation and it will cause eye capillaries' congestion and swelling, which will make your eyes hurt.
Second, in some situations, the cold can raise the pressure of the eyes and it is the high pressure that causes distending pain.
You know when you catch cold, the cough will lead to nerves fatigue around eyes socket even blood congestion. Ductus nasolacrimalis may be congest and swollen, the tears could not running into your nose. It is not feel so good, and may be feel hurt. Moreover, there have some nerve cells in your brain to delivery the visual signals. The messages which pass on by them will translated in some specific thing we know such as birds, tree etc. If the hard coughing shakes your head and brain, these nerve cells tremble, and then misunderstand the message into tiny pieces such as star and light. When the cough is healed, these symptoms will disappear. No worries! You may need some water and nutrients to supply your blood circulation, relax and have a rest, when the cold is healed, the hurt will recover soon. Unless the symptom will last for a long time, you have no need to worry about it.