I just installed the 18.104.22.168 Magento CE, and done some basics configurations, but when I logged out and tried to login again in the admin, I get the error "Invalid Form Key. Please refresh the page."
Does anyone know how to resolve it?
Thank you so much!
Inspect your web page and make sure the formkey input element is included within the form for login. My designer managed to place this input outside the form which didn't help.
You can try to clear your browsers cookie first and then try to login.
Usually all that has ever been needed is clearing the admin cookie referencing your website. New session assigned, issue goes away.
And don't bookmark admin URLs with formkeys or leave them open in a tab. It can bring the issue back. Always bookmark the clean Admin panel URL and use that.
Such issues comes due to cookies or cache problem. Delete cache from your magento_root/var/cache and remove cookies from your browser. One more reason may be incorrect data in web/cookie/cookie_domain and web/cookie/cookie_path values in core_config_data table.
I am pretty sure that problems come from session storage & cookie setting
I blogged it detail here:
You basically should do these things:
DELETE FROM core_config_data WHERE path='web/cookie/cookie_domain'; DELETE FROM core_config_data WHERE path='web/cookie/cookie_path';
check your /app/etc/local.xml
After running those MySQL queries, don't forget to clear browser cache and from magento root directory, go to var folder and delete cache and session folder.
Note: If you'll delete the session folder all the users will be logged out and need to login again.
clear cookie domain and path from core config data and change session storage in local.xml from db to files or vice versa.
That usually sorts out when it happens to me.
There are 2 simple ways to deal with this Magento error.
The 1st one is adjusting the ‘max_input_vars’ to be greater than a 1000 and change server configuration.
The 2nd one is removing the setting without access to the admin panel.
To find more details about each solution, please read here:
I found that if I have this issue it has to do with chrome. If I try edge, exploder or firefox, the issue does not excist.