You are going through nicotine withdrawal and nightmares can be part of the withdrawal symptoms. The medical literature states that these will decrease
Free articles and multimedia from The NY Times, including information on symptoms, diagnosis, treatments, tests, and surgical procedures, as well as current news and