Magento – Invalid Form Key. Please refresh the page

adminformsmagento2pageproduct

I am unable to save the product in Magento 2.

It shows "Invalid Form Key. Please refresh the page. in local

enter image description here

how to resolve this?

Best Answer

This bug arises due to php.ini variable "max_input_vars" Increase it to 10000 through below php function:

ini_set('max_input_vars', 10000);

OR Using linux command line

cd /etc/php/7.0/apache2/
vi php.ini (Open for edit and set max_input_vars=10000)
:wq(Press esc and write the mentioned command to save and exit)
sudo /etc/init.d/apache2 restart(Restart Server)
Related Topic