Magento2 Product Save – Magento 2.2.2 Error: ‘Invalid Form Key. Please Refresh the Page’ on Product Save

magento2productsave

I add some custom option in sample product. I save this product and add changes in custom option.

But I can not save the product. and get this error,

Invalid Form Key. Please refresh the page.

enter image description here

Best Answer

This problem is occurred after adding more custom options and categories in the product so because php.ini file not allowed to add more custom options.

So, we need to change default settings of php.ini file.

If php version 7.1 then,

/etc/php/7.1/apache2/php.ini

If php version 7.0 then,

/etc/php/7.0/apache2/php.ini

If php version 7.2 then,

/etc/php/7.0/apache2/php.ini

Uncomment this value and update this all value in php.ini,

max_input_vars = 200000
max_input_time = 600
max_execution_time = 3600

Then Restart Apache 2 web server, and check it.

sudo service apache2 restart
Related Topic