cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid Form Key. Please refresh the page

Invalid Form Key. Please refresh the page

I have tried every solution I could find.  I tried editing my php.ini file to increase max_input_vars, and it just is not working for me.  Every time I go to login, i enter my credentials and it takes me to the 2FA page and I'm seeing this error.  Does anyone else know how to fix this other than the already suggested fix of max_input_vars, which is not working for me.....thanks!

 

mage errormage error

7 REPLIES 7

Re: Invalid Form Key. Please refresh the page

I still have this issue. 

Magento version 2.4.3. 

Php 7.4.22

Elasticsearch 7.9

Ubuntu 18.04

 

Google Authenticator - 2FA

 

Is this something pertaining to 2FA?  That's when I see the message.  When i enter my code for 2FA and proceed to the admin panel, the message goes away.  I keep getting contacted by the admins saying they get this error.  It happens consistently, every time I try and login.  

 

I've tried increasing max_input_vars.  Is this configured in multiple places, and I'm just missing it?  I would think that php.ini would be the beholder of that setting, but maybe I'm wrong.

 

 

Re: Invalid Form Key. Please refresh the page

Nobody has any other suggestions for this?  This is still an issue and really causing confusion with my admins.

Re: Invalid Form Key. Please refresh the page

You can Disable the authentication and try again

bin/magento module:disable Magento_TwoFactorAuth
bin/magento cache:flush 

Re: Invalid Form Key. Please refresh the page

hi @mattisjd  Could You find any solution regarding this issue ?

I am Facing Same Issue.

Re: Invalid Form Key. Please refresh the page

The issue for me pertains to the admin url.  When i initially setup the magento install, i had changed the backend url to something much easier to remember, knowing that i could change that when i was done installing and configuring the website.  However, that was not the case.  As soon as I changed the url, it started giving me the Invalid form key error.  When I reverted back to what it was at the time of installation, the error goes away.  This seems like a valid bug, because I can reproduce this every single time.  I gave up on looking for answers here.  I will most likely move away from Magento.  There's too many things I don't like, specifically the required Elasticsearch approach that was taken. It just takes too many resources to run a small website.

Re: Invalid Form Key. Please refresh the page

Same issue here. I see the message as soon as the login goes to 2FA - Google Auth, the same as your screenshot. 

Only experienced this since upgrading to 2.4.3

Re: Invalid Form Key. Please refresh the page

Please run the below command in the terminal Magento root path:

bin/magento module:disable Magento_TwoFactorAuth
bin/magento cache:flush

After running these commands refresh the page then you do not get a 2FA page, you get only a login page then you will enter correct credentials and successfully login Magento dashboard.