magento2: "Invalid Form Key. Please refresh the page." error when assigning more than 1,200 products to a category.

Preconditions (*)

  1. Ubuntu 18.04
  2. Apache 2.4
  3. PHP 7.2
  4. Magento 2.3.x
  5. Magento sample data

Steps to reproduce (*)

  1. Go to the category with more than 1000+ products
  2. Open ‘Products in category’ section
  3. Uncheck ‘Select all’ checkbox and check it again
  4. Press ‘Next page’ button

Expected result (*)

  1. Products successfully selected
  2. User is able to proceed and save the category configuration

Actual result (*)

  1. Upon selecting all entries on the 7th page with 200 results per page, the user receives an error: “Invalid Form Key. Please refresh the page.” image

I have read that this can be a problem with PHP’s max_input_vars setting, which I have changed to 75,000. I have cleared the cache and my browser and the problem persists.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 21 (9 by maintainers)

Most upvoted comments

I know that Magento just got bought out by Adobe, so hopefully their added resources will provide more of a focus on up-to-date documentation but, honestly, I’ve abandoned Magento because the documentation is just… absent.

When you spend weeks trying to solve a problem in your code, only to find that the controller you are relying on hasn’t even been written (another issue I had with 2.1), it makes you wonder why the developers of the software are even allowed to mention production environments.