When I cough it tastes salty, why?

Phlegm. Sounds like you are producing phlegm. I wouldn't get too excited about this unless it is bothering you. If it does, then consider seeing your doctor for evaluation and possible treatment.