cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid form key. Magento 2

SOLVED

Invalid form key. Magento 2

When we add a configurable product and assign more then ten attributes from a attribute set for example colour and size, we then hit save it returns "Invalid form key. Please refresh the page". Is this a bug within Magento or a set up issue on our end... Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Invalid form key. Magento 2

Please ask hosting provider to increase php_value max_input_vars 75000.

  1. Remove app/code/local/Mage/Core/Model/Session.php is exist.
  2. Try to clear the cache from var/cache directory.
  3. Then clear browser cache. Especially clear or delete cookies.

 

Hope this helps you!

 

Regards

Manish

OpenSource Expert | OpenSource Technologies | www.opensourcetechnologies.com
Magento plugins released: http://www.opensourcetechnologies.com/product/product-category/magento-extensions

View solution in original post

20 REPLIES 20

Re: Invalid form key. Magento 2

Please ask hosting provider to increase php_value max_input_vars 75000.

  1. Remove app/code/local/Mage/Core/Model/Session.php is exist.
  2. Try to clear the cache from var/cache directory.
  3. Then clear browser cache. Especially clear or delete cookies.

 

Hope this helps you!

 

Regards

Manish

OpenSource Expert | OpenSource Technologies | www.opensourcetechnologies.com
Magento plugins released: http://www.opensourcetechnologies.com/product/product-category/magento-extensions

Re: Invalid form key. Magento 2

Hi Guys,

 

Thank you for the comment as I increased the max_input_vars as you suggested and It resolved the problem. Again many thanks for the assistance with this.

 

Kind Reggards

Jez

Re: Invalid form key. Magento 2

This solution doesn't work

Re: Invalid form key. Magento 2

Open your server's php.ini file with root user, search for `max_input_vars` and set its value as `100000` and it will solve your problem.

max_input_vars = 100000

 

Re: Invalid form key. Magento 2

Sorry, but this could not be a solution. This looks more like an workaround. Increasing the size of the parameter if this error occured results in a very unsecure (DOS) server configuration. It looks more like a misconception in the implementation or an bug.

Re: Invalid form key. Magento 2

100000???? The default is 1000. So you're saying magento needs 100x more than the vast majority of other php programs in existence?!?!

 

Re: Invalid form key. Magento 2

In root directory php.ini

add line

-----------------------------------------------
max_input_vars=10000

-----------------------------------------------

This is will solve your issue.

Re: Invalid form key. Magento 2

If anyone had this issue on localhost.

Issue can be solved by changing domain url from localhost to 127.0.0.1

Can be changed in database in core_config_data

set  web/unsecure/base_url  to http://127.0.0.1

 

After this clear cache and its works.

 

 

I had this issue when login to backend and when adding to basket.

Re: Invalid form key. Magento 2

Still not working.

And this issue occurs only on chrome browser.