magento2: "Invalid Form Key. Please refresh the page." error when assigning more than 1,200 products to a category.
Preconditions (*)
- Ubuntu 18.04
- Apache 2.4
- PHP 7.2
- Magento 2.3.x
- Magento sample data
Steps to reproduce (*)
- Go to the category with more than 1000+ products
- Open ‘Products in category’ section
- Uncheck ‘Select all’ checkbox and check it again
- Press ‘Next page’ button
Expected result (*)
- Products successfully selected
- User is able to proceed and save the category configuration
Actual result (*)
- 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.”

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)
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.