I have a really big problem with my magento installation, everything was working fine til today - now session in frontend and in backend is not working at all - i can't add product to cart or do anything else because form key is always mismatched with the one on the server and i can't log into admin panel because it just reloads the page when i try to log in.

I tried changing my session storage from db to files - no effect, my timezone is set correctly and there is no error in any of the log files, only through debbuging i found that the problem is with form key.

To be honest, i'm out of ideas as i tried to fix that all day long. Did someone had problem like that before? My setup:

Magento 2.4.3 Nginx server, php-fpm 7.4, Mysql v. 10.4.18-MariaDB
I have my installation on dedicated local web address, not localhost

I don't even know what other information i should provide as i cannot pinpoint the source of the problem, so if you need anything else, I will gladly share

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.