Sometimes I'm receiving this message below during the customer login after being changed the cookie domain through the admin panel.
Do you know why and when this message shows up?
Invalid Form Key. Please refresh the page
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
If you receive the error message, in cases where the form_key should still be valid, it is in most cases an issue in the cookie setup. If Magento can not find the form_key from your cookie, the form_key validation will fail. Issues for this could be an invalid cookie-domain, cookie-lifetime, ...
After copying your magento 1 site to a new domain, Varien.php may still have the old domain name in the file.
To ensure your admin form is using the new 'cookie domain, update any references to your old domain in the Varien.php file located in your site at: /<magento_html_dir>/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
After making the edits, run a cache flush/clean, and reindex all (n98-magerun tool is good for this): Example: n98-magerun tool n98-magerun cache:clean n98-magerun cache:flush n98-magerun index:reindex:all
Hope it works!