"invalid form key. please refresh the page" - cannot login to admin panel

I regularly visit my site to make sure its working and noticed that images for products were not appearing, thinking it was a problem with indexing cache I tried to login to the admin panel and received the error:

"invalid form key. please refresh the page"


Other symptoms are customers could not add products to cart and extremely slow performance.

There are no errors in the logs (/var/logs)

What additional steps should I perform to resolve this issue?


I am posting the question / answer because I couldn't find anything relevant.

The issue was that the drive on which my magento installation resides was full. I freed up some room, clear the /var/session and /var/cache and everything went back to normal.

It also happens if the cookie domain in System > Configuration > Web > Cookies is different from the actual site domain.

To remove the setting without access to the admin panel:

  1. use the following SQL query on the MySQL console or in a client like phpMyAdmin:

    DELETE FROM core_config_data WHERE path='web/cookie/cookie_domain';
  2. clear the cache. If you are using the default file based cache backend, delete all directories below var/cache.

Then as soon as you can log in again, set the correct cookie domain for each website or store (Example: .example.com for example.com, www.example.com and all other subdomains)

If you are using n98-magerun (and you should!), the same can be accomplished with:

n98-magerun config:delete web/cookie/cookie_domain
n98-magerun cache:clean config

There are 3 solutions:

  1. Use these commands in phpmyadmin

    DELETE FROM core_config_data WHERE path='web/cookie/cookie_domain';

    DELETE FROM core_config_data WHERE path='web/cookie/cookie_path';

Now Try to login.

2.Delete everything in var folder and then check if it works.

3.Replace the .htaccess file with sample .htaccess file and then try to login the admin.

Hope it help you.

Similar questions

"Invalid Form Key. Please refresh the page." error on Contact us page
The error "Invalid Form Key. Please refresh the page." appears when submitting the contact form. I just don't know how to handle this. :( In my opinion, this must not even be supposed to happen. How can I get rid of this error?
Invalid Form Key. Please refresh the page. error on product save
Hello AllI am getting this error "Invalid Form Key. Please refresh the page." whenever I try to save my product on admin panel. I have gone through this link here but no success. When I looked at my log file it displayed me this I commented out the lines in the file as suggested in this article here. And the errors in log files were gone. But still...
magento upgrade issue Invalid Form Key. Please refresh the page
After Upgrade 1.9.3 Unable to admin login getting below Error
Invalid Form Key. Please refresh the page?
I am unable to save the product in Magento 2. It shows "Invalid Form Key. Please refresh the page. in local how to resolve this?
Invalid Form Key, Please Refresh Page at Checkout Magento 1.9.1
i havent changed any cookies settings that some people have mentioned to try. I did install memcache, im not sure if that is related. local.xml
Invalid form key please refresh the page magento2
Can any one help me for below issue while saving the product iam getting : Invalid form key Please refresh the page page is not saving I was also tried by changing the max_input_vars Help me great thanks in advance

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.