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

Jira vs Airtable: Which Is the Best Project Management Tool in 2023?

Modern project management environment is rich in tools and solutions, which makes choosing the right tool that will boost your team’s productivity and communication a crucial task. Meanwhile, two market leaders aspiring for domination in this space are Jira and Airtable as 2023 begins. By the end of this article, we shall go on an…

Converting genesis Child theme to HTML5

As you know, Genesis 2.0 has been released that have the support of HTML5. Not every and previously released themes are HTML5 ready so we will learn how to convert them from xHTML markup to HTML5. There are some Hooks, and Classes that needs to be changed. Hooks genesis_post_content will change to genesis_entry_content genesis_after_post_content will…

Designing for Accessibility: Making Your Website Inclusive for All Users

Introduction Today, web presence is the first face that people get to see of any business or organization. But are you leaving some of your audience outside? Accessibility basically means that everyone including the disabled can be able to find and use your website. That is a good starting point; let’s talk about why and…

What Is Programmer Imposter Syndrome and How Can You Deal With It?

Introduction As the programming realm is obviously characterized by a high pace of creating new ideas and developing respective new products, there is a problem that many programmers fight silently – the Programmer Imposter Syndrome. This is not simply thinking one is incompetent; it is a psychological pattern that makes people believe that they got…

Cloud Readiness Assessment: Key Considerations and Best Practices

Taking into account the tendencies of modern business technology development, transferring to the cloud has turned into much more than mere preference – it has become THE necessity. Thus, cloud computing is characterized by great scalability, flexibility, and cost effectiveness. But getting to the cloud is not as easy as flicking a switch. Nonetheless, an…

Top 10 Machine Learning Algorithms for Beginners

Artificial intelligence is a new powerful tool that helps computers to solve complicated problems, learning from the data received. This is especially so if you are just entering this field with the various types of algorithms available being a major factor to divide on. Fear not! Here, and in the next sections of this article,…

R vs Python: Which Is Better?

Changes in the world of data science led to programming languages being almost in a constant fight against each other. Two of the most popular noteworthy languages in this context are R and Python. Depending on your choice, it will be much easier or fierce when dealing with your data analysis, so let us discuss…

Core Web Vitals: What Are They and How to Improve Them?

Website usability, otherwise known as user experience, has emerged as one of the vital aspects that defines the performance of a website especially in the current world that is characterized by hi-tech environment. It’s one thing to be producing good content, but it’s way beyond producing good content; it is also about how to produce…

What Is Best for App Development: Flutter, Dart Language or Something Else?

In the rapidly growing sector of mobile application development, the decision on the choice of the kind of framework as well as the programming language to use is delicate. As seems the case with most technologies, developers are left with a dilemma, wondering which of the many options would make the most sense. In this…

How to Hire Great Tech Talent from the CEE Region Amidst Challenges?

Another trend that emerged from the short description is that the search for qualified talent and their recruitment remain a truly international issue in the contemporary globalized environment for IT companies. Still, for numerous enterprises, Central and Eastern Europe (CEE) has become the treasure chest of qualified workforce. This article will help you to understand…

C# vs Golang: Which Is the Best Web Development Language?

Introduction This is one of the critical areas that require attention in the ever-developing filed on web development. Main rivals in this field are considered to be C# and Golang (or Go). Each has its advantages and disadvantages, and the choice of which language often determines success or failure of the developed web site. This…

App development and its 4 phases, Explain?

The development of the application has become an essential aspect of the modern world and influences different fields. Namely, new businesses, SMBs, or corporations should have an understanding of what phase of app development they are in if they want to create an efficient and user-friendly application. Introduction In the current world, apps are the…

Make Your Own Music Beats with GarageBand

Do you sometimes wish to get into beat making – to write your own beats but have no idea where to begin? My music production partner is GarageBand! This free and flexible music composing application will then be a valuable addition to the arsenal of any novice or professional composer. In this post let’s dive…

How to Use Figma for Website Prototyping and Design

Introduction If you use or plan to use website design and prototyping, welcome to Figma! It is not just a tool where you get to design but also a full blown comprehensive environment that makes your ideas real. But how can it be utilized to design modern and intuitive websites? Now let’s see how it…

Cybersecurity Best Practices for Small Businesses

Introduction Cyber security has not become a word in today’s technological world but a necessity to conduct a proper business organization. Due to the small budget, poor financial position, and limited control over technology and innovation Small businesses need to protect themselves against Cyber threats that can harm them so implementing strong cybersecurity measures is…

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…

The Psychology of Learning: How to Design Tutorials that Stick

Introduction In fact, creating well-executed tutorials is not merely a matter of passing on information; it requires an understanding of how the brain learns. That’s why incorporating learning psychology into your tutorials lets you create not only accurate but also fun and viral. But why is learning psychology of concern? It assists you establish your…

How to fix “Magento is already installed” error

If you are new to magento or magento installation you might encounter this weird bug during the New installation of Magento 1.x family. This error can be happened due to variety of reasons; lets not discuss them; the most common reason if you encounter a write permission error on session variables and you remove all…

Master Watercolor Painting Techniques with These Easy Steps

Are you willing to start your journey with watercolor painting? Watercolor can be one of the most satisfying mediums due to a range of beautiful washes and rich colours. From a novice wishing to start the journey to one looking to optimize their performance, these steps will help you get there. Time for you to…

How to Design Digital Flashcards for Learning

I mean let’s face it, studying is not the most exciting thing in the world to do. But imagine if to learn has to be colorful, engaging, and highly effective? Enter digital flashcards! So, now you know that with the correct approach, you don’t have to sit through dull study sessions. Now it is time…

10 Creative Approaches to Teaching Through Tutorials

It is worth stating that in today’s world of fast learning tutorials, tutorials are not only the mean for imparting knowledge but also the way how to inspire and empower learners. But who in turn can explain how one can make his tutorials special? Below, I outline ten tutorial session ideas that will engage your…

How to Stay Motivated While Creating Your Tutorials

This paper focuses on motivation in creative work and how it can be understood. Producing tutorials itself can be quite rewarding but at times maintaining that motivation is quite tricky- let’s be real here. Therefore, what motivates one to be creative and maintain that motivation comprehensible and tangible? What Drives Us to Create? Most of…

Master Public Speaking with These 10 Easy Tutorials

It is one of the most precious skills that one should equip himself or herself depending on the type of career, social events like giving a speech during wedding ,etc. But let’s face reality—it is also one of the creepiest. Don’t worry! With these 10 easy tutorials, you’ll go from shaking to shining on stage….

Essential Tools Every Freelancer Needs

You are just starting your freelancing journey! A company where people weren’t managing you and telling you what to do, when to do it and which job to do. Sounds like a dream, right? It can be, but it does not have to be that way if you are armed with the right tools for…