Question: I was riding late in the night and weather was colder than what we normally have.
(May not be cold for others, but it was cold for us, people used to with typical subcontinental weather. Temperature had dropped to 5 oC, which is wayyy cold for us)  

While riding my way back home which takes hours, I kept on getting tempted to stand nearby a bonfire set up in villages on the way.

I wasn't having enough clothing to keep me warm, which I agree is a stupid thing to go with. Though, despite of being tempted to stand by a bonfire, I refrained from doing so, because I thought I would have felt a bit warm and better, but would have to start riding again which would make me cold and may be I'd end up feeling colder than before.

Was it the right thing to do?

Answer: 
**EDIT:** Please also read the other answer, which tells you why wrong (well perhaps not for 100% of the cases=)

This is just *my* experience: I would warm up if I felt cold and had the opportunity to do so. Sure, slowly getting cold again is not comfortable, but staying cold for an even longer time is worse. 

Another effect that I noticed is that warming up really brightens the mood (especially if you are with other people), which obviously again helps bearing the cold. E.g. in outdoor camps we used to say that the *moodkillers* were 

* being cold/soaken
* being hungry (or only having bad food)
* being tired

And any combination of those makes the others worse. And sums it up pretty well in my experience.
I think part of what is missing in your question and the answer by flawr is core body temperature. 

When you first get cold your body automatically shunts blood away from the surface of your skin to decrease heat loss. As you get colder your core body temperature falls (you could think of it like the cold sinking in, but that is not literally true).

When you stand next to the fire, your outer skin starts to warm, but your core temperature does not respond as quickly. Most of your nerves for temperature are in your skin, not in your muscles and insides. When your skin gets to a certain temperature, your body responds by pushing more blood to the surface, trying to keep you from overheating. 

You step away from the fire and your skin is still warm and flushed with blood, you will likely have increased heat loss until your blood vessels in your skin shunt the blood back to your core. 

In much the same way that a fire in a fireplace (as opposed to an airtight stove) can result in a net heat loss to the house, a short heating next to a hot fire on a cold day can result in a net heat loss to your body. There are of course many variables, but if you are feeling colder, you probably are.

**Edit**
Per request in comments I looked for research specific to the scenario I described. I have included several references to the basic principals of heat exchange related to blood at the skin level. I did not find anything specific to net heat loss **OR** gain from a short warming near the fire. I have experienced this perceived colder after a brief warming, and while I believe my hypothesis above is realistic, it seems to be untested under scientific conditions. 

References

* [NEUROPHYSIOLOGY OF THERMOREGULATION](http://dwb.unl.edu/teacher/nsf/c01/c01links/www.science.mcmaster.ca/biology/4s03/thermoregulation.html)
* [PHYSIOLOGICAL RESPONSES TO THE THERMAL ENVIRONMENT](http://www.ilocis.org/documents/chpt42e.htm)
* [Outdoor Action Guide to
Hypothermia And Cold Weather Injuries](https://www.princeton.edu/~oa/safety/hypocold.shtml)