cancel
Showing results for 
Search instead for 
Did you mean: 

error msg 'Invalid security or form key. Please refresh the page'- Magento 2.4.2-p2

error msg 'Invalid security or form key. Please refresh the page'- Magento 2.4.2-p2

error 'Invalid security or form key. Please refresh the page' displays after login to admin backend Then refresh the page, the msg disappear.

 

Screen Shot 2564-10-07 at 12.00.01.png

4 REPLIES 4

Re: error msg 'Invalid security or form key. Please refresh the page'- Magento 2.4.2-p2

Hi @napawanjac68c2,

 

Greetings!

 

First, try to refresh the page. There can be many reasons behind this error. Still facing the same issue then try the following solutions.

1. Try changing your base URL. 

It can be possible that your base URL is not recognized by Magento 2 system. generally, it is possible when you are working in localhost. Run the following command to change the URL. 

php bin/magento setup:store-config:set --base-url="http://127.0.0.1:8080/"

Flush your cache once you change the URL.

 

2. Maximize the max_input_vars in the php.ini file.

The default value of max_input_vars in php.ini is set to 1000.  Edit the value from 1000 to 5000 and then save the file. 

 

Hope this will help you!

If not, feel free to contact us.

 

Solved?

Accept as a solution and click KUDOS.

Thank you!

 

Re: error msg 'Invalid security or form key. Please refresh the page'- Magento 2.4.2-p2

hi @namitapare2a78 after refresh the page, the msg disappear. but when I login admin again. it's still to show error msg

Re: error msg 'Invalid security or form key. Please refresh the page'- Magento 2.4.2-p2

Hi @napawanjac68c2,

 

Thanks for your reply!

 

Kindly try the other solutions I have mentioned.

 

Regards!

Re: error msg 'Invalid security or form key. Please refresh the page'- Magento 2.4.2-p2

@namitapare2a78  thank you. 

i change max_input_vars 10000 to 50000 and checked base URL but it's still not work.

it's happen on magento cloud but on Docker not found this issue