How to fix “Invalid Form Key. Please refresh the page.” error on Magento Backend

So you’re also having this “Invalid Form Key. Please refresh the page.” error and not able to login to your newly installed Magento Backend interface? No worries in this short article we will learn how to fix it.

There are number of reasons behind this and different solution works for different people so lets closely go through some of them.

Solution # 1: Use Database to save session
Often it seems that the “files” method to store session doesn’t work due to file permissions or other related issues so you can switch to Database method by making the change in app/etc/local.xml
Search for:

< ![CDATA[files]]>

and replace with:

< ![CDATA[db]]>

Save the file and sessions will now be stored in the database instead of files. Although you might see performance issues if you are running a large web store or multi sites with great number of products.

Solution # 2: Files & Folders Permission
So instead of switching to Database method for storing sessions we discussed above you make sure the folder /var/cache have the right permissions (0755 should be enough though but it has been noticed that some servers require 0777 on those folders), and writable to the user running php so magento can create new session files in that folder. if folder is not writable you are more likely to encounter the error.

Solution # 3: Core Config Data Table
For many users the problem lies in database. There are 2 of the possible fixes written below, if this is really a database issue.
Please note: If you find multiple entries for the following be sure to only use the default one or the one you want to change because resetting/removing the wrong entry might break your magento webstore completely.

  1. Reset the following:
    Browse core_config_data table (you might have to add the db/table prefix)
SELECT * FROM `core_config_data` WHERE `path` = "web/cookie/cookie_domain";
Set the above path value to null
SELECT * FROM core_config_data WHERE path="web/cookie/cookie_path";

set the value to above path to /

  1. Delete the following entries
    If the above code not help you then deleting the following entries from core_config_data table will help fixing the issue.
DELETE FROM `core_config_data` WHERE `path` = "web/cookie/cookie_domain";
DELETE FROM `core_config_data` WHERE `path` = "web/cookie/cookie_path";

Solution # 4: Cookies, Cache issue
If nothing mentioned above works for you don’t give up it’s more likely a bad Cookie issue. The simple solution is to delete cache, cookies from your browser. Also its nice to clear up magento cache if it doesn’t hurt you.

Please feel to reach to us if you don’t get it fixed.

Sign Up To Get The Latest Digital Trends

Our Newsletter

Related Posts

How Turing Is Leveraging AI for Matching and Evaluating Developers?

The importance of skilled developers does not fade over time, in relation to the fast growth of technology. IT specialists within every sphere are in constant search of the best developers to achieve their corporate initiatives in digital areas. This quest, however, is not without its challenges and thus, the remaining sections of this paper…

You Must Know These 6 DevOps Best Practices in 2023

The computer and software industry is ever-growing and keen on changing, that is why DevOps has become an essential way to function in the ever-evolving world. In this article, I will be telling you about the vital DevOps theory that you should know in the year 2023. Introduction DevOps is an umbrella term that combines…

Here Are the 10 Best Web Development Trends for 2023

As the field and technology progresses, the goal remains to constantly update the previously established knowledge in order to create applications and websites that are compatible with the current expectations of the users. Well, the year 2023 has already come, and perhaps it is high time to unveil the tendencies that will headline the web…

Multi-Cloud vs Hybrid Cloud: 3 Key Differences

Organizations in the contemporary world are adopting cloud computing as a key driver of change to adapt to the increasing growth of digital solutions. Two popular cloud deployment models have emerged as frontrunners in this space: The first is Multi-Cloud which refers to the use of more than one cloud service provider while the second…

Common Product Strategy Mistakes and Ways to Avoid Them

Consequently, having a clear cut product strategy is a crucial factor especially in today’s dynamic business environment to mean the difference between a magnificent success story and total failure. Creating new business products entails a significant amount of time, effort, and work in organizations businesses and the creation involves large amounts of time and often…

Service Mesh: How to Overcome Deployment Challenges?

Thus, microservices architecture stands out as a preferable option for establishing more flexible and agile processes for enterprises in the current conditions of a rapidly growing digital environment. As such, this transition comes with some deployment challenges at the centroid that impacts the effectiveness of the development process. What has been a solution to tackle…

How to Create User-Centric Web Design for an Inclusive Experience

And when it comes to web design, it is equally important to note that ‘one size fits all’ principle can be highly misleading. Your website’s design will get used by people with different needs and different preferences, which is why your website must be as accessible as possible. But how does one design thinking environment…

Crafting a High-Conversion Landing Page

Hey there, digital nomad! Looks like you’re on the lookout for the secret sauce that makes those smashing landing pages so effective in converting. You remember, those which triggers your attention, make you run for them and within no time you are charging your credit card or signing up for something. Join me in this…

Top 25 Scrum Master Interview Questions and Answers for 2023

As the business environment becomes more dynamic, the need for a flexible and responsive team management approach grows and the Scrum Master position becomes extremely significant. Scrum Masters play a very crucial role in today’s development processes, following the Agile methodologies, being adopted by organizations across all industries. When preparing for Scrum Master interview questions…

Artificial Intelligence vs Machine Learning vs Deep Learning: What’s the Difference?

AI, ML, and DL are some of the trending terms in the tech world as everyone is leveraging the technologies. Seemingly, all of them are related, but they denote quite different notions belonging to the sphere of computer science and data analysis. In this article you will learn how these three terms are related and…

Tech Jobs Trends: These 10 Cities Are Witnessing a Spike in Tech Jobs!

The current world is rapidly advancing toward becoming a technological one and as such the market for tech gurus is on the rise. The examples of the stellar performances irrespective of the fluctuations in the economy are in the technology sector. Therefore, many cities in the world are recognized to be having high openings for…

What a Recession Means for Workers’ Battle over Return-To-Office

Introduction The employees all over the world have had a hard time in recent years due to ever-rising challenges. The outbreak of COVID-19 distorted normal working employment structures since most employees were forced to work remotely. As the world gradually recovers from the pandemic, another challenge looms on the horizon: the existence of the possibility…

Debugging 101: Tips for Finding and Fixing Errors in Code

Debugging is another probably the most important process that every programmer has to know. If you’re a software developer or a programmer at any level, it is as certain as night following day that you are going to stumble across errors. But fear not! Debugging doesn’t have to be complicated or completely overwhelming. Now, in…

How to Create Viral Memes with Adobe Spark

Making memes is not just haphazardly typing text over an image but it’s actually a process that needs creativity, timing, and the best equipment. Adobe Spark is an example of a tool that can help make creating memes as easy as A-B-C for the layman. If you don’t know where to start when it comes…

How to Create a Tutorial Website That Attracts Visitors

It is good news if you are considering to develop a tutorial website! But let’s be real; it’s not just about creating some content and then posting it and hoping it works. What you want is a strategy that brings those visitors to sight and keeps them coming back for more. In this article we…

Creating Tutorials with PowerPoint: A Beginner’s Guide

Developing tutorials may be quite overwhelming if you are new in the presentation software world. Nevertheless, PowerPoint is one of the easiest tools to navigate in order to create vivid and informative tutorials. Well, let’s discuss how using PowerPoint is helpful to make tutorials that could engage your audience. Introduction Why Should PowerPoint be Used…

How to Use HTML5 and CSS3 to Build Responsive Websites

Introduction Today, creating ‘responsive’ websites or websites that can be accessed from any device is not just a ‘must-do,’ but it is imperative! Whether you are building a blog or an online shop, HTML5 and CSS3 skills are crucial if you are designing a website today. But how does these two powerful tools assist us…

Leveraging User-Generated Content to Enrich Your Tutorials

Introduction UGC has been discovered in the current generation as a very useful tool for improving on the online tutorials. But first, let’s define what exactly UGC means and why it should be incorporated into the educational material. And now let’s go deeper into the idea of using UGC and how it can help you…

Best Practices for Writing Clean Code

In concerns to the coding, the term such as “Clean code” does not just refer to a trend but rather the guideline that every programmer should live by. At this point, you may be wondering, ‘Okay, clean code then, just what on earth does this mean?’ Alright, it means writing code that is clearly written,…

How to Analyze Data Using Python and R

Introduction When it comes to data analytics both Python and R are two major programming languages that are frequently used. Both possess characteristics that makes them enticing to different group of the data science fraternity. For a professional data scientist or someone who is new to this field, grasp the concept of how to analyze…

Color Theory in Design: How to Choose the Right Palette

Have you ever opened a new painting or writing project and been completely lost for what color to pick? You’re not alone! Just as with many things in design, color theory may seem confusing when you are first approaching it, but it is a very strong concept that you should learn. Well, there’s a bunch…

Boost Productivity with Notion: A Beginner’s Guide

On the job, day by day or in everyday life keeping track of everything is quite challenging due to the present fast pace life. Be it work responsibilities, assignments, or even basic day planning, the choice of tool greatly can impact the system. Meet Notion – an app that will help you get your work…

Font Awesome IE9 & IE10 Problem

Recently, I implemented fontAwesome on one of my project, everything looked great except there were some problem with Internet Explorer 9 and 10, sometimes the icon displayed and most of the time they don’t. I looked around and figure out that something wrong with the Font files. There are 5 files into fonts folder. The…

Types of Animation: A Comprehensive Guide

As you go through this piece, you will be able to understand different aspects that relate to animation. Animation is one of the fascinating and amongst the most flexible categories of media that is in constant development. Whether one is interested in over cominging an animator or just interested in knowing the types of animation,…