Why do I get cottonmouth while sleeping?

Nasal congestion. When you can't breath through your nose you have to breathe with your mouth. While your nose is designed to warm, filter & moisten the air you breath, your mouth is a multi-purpose orifice. Your mouth can't moisten air very well. In trying your mouth and throat become dry. That's the sensation of cottonmouth.