1

While creating the configuration products in Magento2.2.2 I am facing the

Invalid Form Key. Please refresh the page

error. I have google regarding this error and I have found the solution to

Increase the value of max_input_vars PHP configurable variable

I have increased this value but the problem is not solved.

While creating the configurable product almost 40000 associated product is generated and now I have set the max_input_vars value to 3075000 but the problem is not solved.

Anyone, please help me to fix this issue.

  • Then clear browser cache. Especially clear or delete cookies. – Savan Patel Jul 11 '19 at 8:41
  • Try in private window – Mohit Rane Jul 11 '19 at 8:42
  • I have already tried this cache clear and private windows. Even I have tried from another computer but problem not solved. – Narayan Jul 11 '19 at 9:02
  • try restarting the apache server and then check again – surbhi agr Jul 11 '19 at 9:05
  • @surbhiagr I have tried with restart the apache & mysql also. But same problem. – Narayan Jul 11 '19 at 9:41
1

If Linux (Fedora) go to

sudo vi /etc/php.ini

Change memory_limit = 128M to 2040M

check session.gc_maxlifetime if its commented like

";session.gc_maxlifetime"

then change to

session.gc_maxlifetime = 1440

after that restart your apache server

sudo service httpd restart
| improve this answer | |
0

Please check with below possibilities :

1 check with php info max_input_vars are updated or not. may be if you are using multiple php versions, so you assign value to another php.ini also please verify below values :

2 check with your database table core_config_data find path=web/cookie/cookie_domain, if you find row than remove it.

I hope its work for you.

| improve this answer | |
  • yes all the php configuration updated correctly. check the setting here i.imgur.com/6UB1vzE.png. I have already tried this cookie setting before its empty (no records in Db) I have added a record and check again but its not working. then I have reverted by deleting the records – Narayan Jul 16 '19 at 9:53
0

Issue has been resolved by changing the PHP settings.

max_input_vars = 100000
max_input_nesting_level = 800
max_input_time = 18000

Reference :Php max_input_vars prevents attribute options saving in M2

Then run command

if Linux (Debian/Ubuntu):

sudo service apache2 restart
sudo /etc/init.d/apache2 restart
| improve this answer | |
  • max_input_vars & max_input_time I have already set this to maximum. But I don't think we have to increase the max_input_nesting_level to 800. Now it is 64. Can you please tell me why should I increase this as I think 64 level is sufficient. – Narayan Jul 18 '19 at 6:19
  • @Narayan you can contact your server team they are given you perfect number – Rakesh Donga Jul 18 '19 at 6:26
  • Yes I will thanks! – Narayan Jul 18 '19 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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