Server Variables not recognized in certain posts

Turn off your cache, and the variables should work as expected.

Caching saves copies of your output and doesn’t execute the code every time the page loads. As a result, server variables might contain information form a past page load as opposed to a current page load.