Cobra is one of the postures in yoga
that was thought to be dangerous due to compressing the back of the neck and cutting off blood flow to the brain, causing a stroke
This was apparently similar to folks getting their hair washed at the hair salons placing their head back against the sink. Go slower and extend/stretch the spine more gently. If it persists-stop. May need to see your doc.