Question

The error "Invalid Form Key. Please refresh the page." appears when submitting the contact form.

I just don't know how to handle this. :( In my opinion, this must not even be supposed to happen. How can I get rid of this error?

enter image description here

Was it helpful?

Solution

The problem was the missing line inside contact page as seen in the page's source code:

enter image description here

My solution was to overwrite the form.php file of the contact module inside my custom theme so it could generate the line marked in the above picture.

enter image description here

After that I ran the command: ./magento setup:di:compile

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top