Magento Tutorials

Magento 2 “Invalid Form Key. Please refresh the page”

magento-2-invalid-form-key

Sometimes when you create a product with multiple attributes in Magento 2, you may end up with the error message “Invalid Form Key. Please refresh the page.

Magento 2 invalid form key please refresh the page
Magento 2 “Invalid Form Key” error

To get rid of this message, you need to increase the value of max_input_vars in php.ini file. By default, this value is set to 1000. You should set it to 5000 or 10000. To do that, follow these steps:

1. Log in to your website server using ssh
magento server login

2. Go to the folder containing php.ini and open this file by vi
php.ini

3. Edit the value of max_input_vars to 5000 (or create it if it doesn’t exist yet). Then, press ESC key and type :wq to save the file.
max_input_vars

4. Restart your Mamp or Apache. Now you can save your newly created product without any problem.

 

See more:
Magento 2 Error: One or more indexers are invalid
Warning: Your Magento folder does not have sufficient write permissions

Magento 2 “Invalid Form Key. Please refresh the page”
5 (100%) 3 votes
5 Comments

Dom

A knowledge craver who always strive to be wiser everyday.

    5 Comments

    1. Warning: Your Magento folder does not have sufficient write permissions - M commerce blog - SimiCart
      11/24/2017 at 12:47 am

      […] more: Magento 2 “Invalid Form Key” Magento 2 Error: One or more indexers are […]

    2. [Solved] Magento 2 error: One or more indexers are invalid - SimiCart
      12/04/2017 at 9:39 pm

      […] See more: Warning: Your Magento folder does not have sufficient write permissions Magento 2 “Invalid Form Key” […]

    3. Magento 2 File Permissions - Magento Tutorials - SimiCart
      12/04/2017 at 9:57 pm

      […] See more: Magento 2 System Requirements Magento 2 “Invalid Form Key” […]

    4. jyoti
      04/20/2018 at 7:51 pm

      Thank you.You saved my time

      • Dom
        04/23/2018 at 12:04 pm

        You’re welcome!

    Reply your comment

    Your email address will not be published. Required fields are marked*