cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid form key. Magento 2

SOLVED

Re: Invalid form key. Magento 2

Hi

I have increased php_value max_input_vars as suggested.
clear the cache from magento var folder.Also cleared the browser cache and cookies,
But still issue persists..Unable to create customer account and unable to login in frontend using chrome but it works properly in firefox.
Kindly provide a solution


Regards

Re: Invalid form key. Magento 2

These are ridiculous answer nothing is working. only working at Mozilla Firefox working...

Magento 2 is seriously bad coded...

Re: Invalid form key. Magento 2

We receive this error when trying to remove a item from shopping cart, version 2.3.1.

Re: Invalid form key. Magento 2

Try to run in another browser. I faced the same issue in Chrome but didn't face an issue when using Mozilla. It might be some sessions or cache issue. 

Re: Invalid form key. Magento 2

This Worked for me

Re: Invalid form key. Magento 2

Same Issue I am facing so please let me know any solutions and I get many places this issue.

Re: Invalid form key. Magento 2

icant find php.ini file in goddady server. so should ichange here ".user.ini" ??

max_input_vars = 75000

got from : https://in.godaddy.com/help/change-php-settings-for-my-hosting-account-26379

Re: Invalid form key. Magento 2

In 2.3.x and up, "Invalid Form Key" can also happen if a form action is just "/my/controller/path" where it should be:

$this->getUrl('my/controller/path', ['_secure' => true]);

Re: Invalid form key. Magento 2

HI there,
I am experiencing the same issue in product attribute saving but for only on a single attribute. 

It is supposed to be a dropdown with just 13 options.

I made the same attribute with same options with a new name and that gets saved easily without any issue.

My max_input_vars value is 20000, and that there are more attributes with more options that are getting saved normally.

My Magento is 2.4.1

I have tried multiple Chromes and Firefoxs and their incognito modes on different pc/laptops as well so I can say that its not a browser end issue.

 

Please guide what can be the issue.

Re: Invalid form key. Magento 2

Check your web server logs for errors. I my case with nginx I was getting "client intended to send too large body: 3712509 bytes".  I added client_max_body_size 10M;   to server block and it solved the issue.  Restart nginx after editing host file.

If you use apache it should have similar solution, start by looking at error logs