Dear, from what I have experienced, the syrup doesn't last long enough to go bad in my house. The one that has lasted over 6 months was stored in the fridge the entire time. But I can share our root beer recipe that has made a hit here:
RIP Root Beer (A root beer you will die for)
2 1/2 cups table sugar
1/2 cup Splenda (or other artificial sugar)
3 cups water
1 1/2 teaspoons Cream of Tartar
2 teaspoons Root Beer Extract (McCormick- found in most grocery stores)
Mix all but the extract in a pan on the stove, heating it until everything is blended and syrup is clear. Let cool (don't want to melt the bottle). Grab a 32 ounce bottle and pour the extract in there, then add the cool syrup. Lightly shake to mix.
Place about 2 ounces syrup in a 12-16 ounce glass, add carbonated water and ice, if desired. Lightly stir. Then sit back and enjoy.
We do store the syrup in the fridge, but it goes so fast here, it probably will stand sitting on the counter.