Most likely this is coming from one or more of your sinuses. It can be an infection or simply an inflammation that is not infected. There is also a good possibility that this is the cause of your 4-month cough. Having a CT of your sinuses might be a good idea. I would speak to your doctor about sinusitis. Sinusitis is an inflammation of the mucous membranes that line the sinus cavities. Inflammation of the sinuses could be due to an allergy, an infection, or ongoing exposure to an irritant, such as pollution or smoke.
If you continue to have the orangish-brown mucus, you really need to have this checked out. It could be a fungal infection.