LavooijMedia
LavooijMedia

Based in Bournemouth since 2015, a full-stack web developer for a digital agency. In my spare time I work as a freelancer and love playing around with new and exciting web stuff and gadgets.

Ruben Lavooij
Author

Share


Tags


On this blog I happily talk about techy, geeky and (for me) fun stuff. I will be talking about all the problems / challenges I find in my day to day job, with examples, and how I have fixed those things. And maybe some of my 3D printing projects.

If you are having problems with your site, or need some work done, do not hesitate to contact me for a quick chat.

07-493102199 or info@lavooijmedia.uk
If calling during work hours leave a message and I will call you back as soon as I can!

Twitter


LavooijMedia

Can't login to admin, "Invalid Form Key. Please refresh the page."

Ruben LavooijRuben Lavooij

If you are moving Magento 1 sites around, this might look familiar. Especially if you are moving it to a different domain it comes to bite you while you want to log in to the backend of your site.

But, there's a way to fix it!!

First, Clear the var/cache. and remove browser cookies.
Secondly try to use incognito mode of your preferred browser.
Now this almost never fixes this problem for me, but if you are one of the thousand. cool!

Next up, to the app/code/local.xml file. Make sure to change the session values to write to a temp folder by doing the following:
Comment out the following:

<session_save><![CDATA[db]]></session_save>

and add:

<session_save><![CDATA[files]]></session_save>
<session_save_path><![CDATA[/tmp/session]]></session_save_path>

Now, one last thing to do, remove (or set the correct) the cookie domain in the database.

DELETE FROM core_config_data WHERE path='web/cookie/cookie_domain';
DELETE FROM core_config_data WHERE path='web/cookie/cookie_path';

Clear the cache and cookies again before trying to log in again! now it should work!!

Author

Ruben Lavooij

Comments