cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid Form Key. Please refresh the page.

Highlighted

Re: Invalid Form Key. Please refresh the page.

Hi @fabio_alves1

 

well in your var/log directory of magento2 root directory.

 

there should be a logs file like exceptions.log , system.log etc. so check is there any error showing over there or not !!

 

also which magento 2 version are you using ?

if issue solved,Click Kudos & Accept as Solution
Highlighted

Re: Invalid Form Key. Please refresh the page.

Changing the max_input_vars solved my issue.  I am using Advanced Bundled Products by Xumulus and the client needed to enter over thirty options.  I believe all of the data was getting passed via JavaScript and failing because the max_input_vars (https://www.php.net/manual/en/info.configuration.php#ini.max-input-vars).  Here are my PHP INI basic settings that are working well for me.

 

max_execution_time: 18000

max_input_time: 6000

max_input_vars: 10000

memory_limit: 2048M

post_max_size: 128M

session.gc_maxlifetime: 1440

upload_max_filesize: 32M

 

If anyone has suggestions on these settings please feel free to let me know.  Thank you fabio_alves1 for posting this solution.  Saved me so much time and frustration.

Highlighted

Re: Invalid Form Key. Please refresh the page.

This solved my problem also: 

max_input_vars = 10000

Highlighted

Re: Invalid Form Key. Please refresh the page.

Hello! I hope all of you are doing well.

 

I know, i'm a new member and reviving an old post is not the right way to start in a forum, but i have found a really simple solution that i wanted to share with you guys.

Since the last few days this same issue freaked me out, and today i found a possible solution that worked well on Magento 1.9, and i assume that may work well on Magento 2 as well.

 

Basically, in the Magento's root folder:

rm -rf var/
mkdir var/log
mkdir var/cache
chown -R www-data var/
chgrp -R www-data var/

The issue may be related to the ability of writing on the var directory, or for creating the log, cache files, etc.

 

I hope that this helps somebody else.

 

Thanks and Regards,

 

Alan.