From your history there is no doubt that you have a nasal allergy. The nasal discharge that is natural with allergy generally falls into the throat as it is watery when produced and it is discharged from the nostrils only when there is an excess amount or if there is a mechanical blockage. In your case it seems the discharge gets stuck in the nose and the sinuses and then gets thick and sticky. This then falls into the throat and produces the cough you are talking about. If the cough or the sputum smells, that means there is a definite stasis of pus somewhere and thus an infection. For this:
Drink plenty of water to hydrate yourself.
Clean the nose with a solution of 1 spoon of baking powder and 1 glass warm water.
Take steam inhalation with menthol.
If this does not solve the problem, then the doctor needs to see you with an endoscope to find out the status of your nose.