I recently run into a situation where we had a custom piece of code that needed a Form Key as soon as possible after page load. However the first request to Magento doesn’t set the form_key cookie for first time visitors that land on a page that’s cached. Our KnockoutJS component, which was being loaded as early as possible, received an empty value when trying to read from windows.FORM_KEY or even document.cookie .