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

Software Development: The Most Important Tech Job in the Future

In a world increasingly driven by technology, there’s one profession that stands out as the cornerstone of modern innovation: computer software development. Having said so, one has to agree that with the development and progressing implementation of digital solutions across various industries, the demand for software developers has risen to the core. Software development transcends…

The Power of Storytelling in Web Design

In the modern world, where the majority of population tend to spend most of their time online and where the average attention span is rapidly shrinking, the role of storytelling in Website design has become one of the most effective tools to attract clients’ attention. Thus, storytelling in this context can be defined as an…

What Business Opportunities Can 5G Open Up Across Sectors?

In the recent years, the conspicuous rate at which new technologies are being developed has been nothing short of spectacular, and thus its introduction of the 5G has lit up the atmosphere’. 5G or the fifth generation of wireless technology carries the promise of a revolutionary experience to different industries and sectors in the way…

National Day of Ethical Hacking Special: How to Become an Ethical Hacker?

Introduction The Very Nature of Today’s Threats Is Just as Complex and the Demand for Skilled Cybersecurity Professionals Is Only Growing. Ethical hackers are individuals that work to secure technology environments in advance of threats, by hacking into systems legally. In honor of the National Day of Ethical Hacking I have created this article and…

What Is the Shift-Left Approach and How You Can Prevent It from Making Your Developers Stressed

Introduction In such a high-tempo environment for software development, the new methods and practices appear constantly, and this influences the cooperation, creativity, and app development. Indeed, there is such a concept as the “Shift-Left.” This article will explain what is behind Shift-Left and see how it could be avoided to become an issue for the…

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…

Navigating Multicloud Architecture for Resilient Applications

Introduction Today, applications rely on the cloud and this is something that business entities can ill afford to downplay. But this means entrusting your IT service to the provider entirely: single-cloud providers can sometimes go down, while using a single provider type is expensive for the same reason. This is where multicloud architecture falls into…

The Ethical Considerations in Web Design

Today web design is not only aesthetic and efficient creation of web sites but also ethical point of view. In many instances; as web designers, we have the ability to shape how the user perceives and further interacts with the site. Alright, let me give a brief look at all the ethical concerns that go…

10 Best VueJS Frameworks for Web Development

Today VueJS is one of the efficient and flexible frameworks used in the progress of web development. Due to its relative simplicity and versatility, it is widely used by developers to create extensible and tight web apps. Nevertheless, the utilization of VueJS multiplies its talent when incorporated with other frameworks and libraries that form the…

9 Effective Ways for Remote Software Developers to Improve Productivity

Remote work is now very common in today’s society mainly because the world is now computerized and people can work from anywhere. Even though remote work has its advantages like you don’t have to go to the office and interact with people all the time, there are some disadvantages as well. Procrastination, loneliness and lack…

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…

Why Should You Include Games in Candidate Assessment?

Subsequently, one might suggest that the rapidly changing environment of the global job market has been instrumental in the ongoing alteration of conventional practices for the assessment of candidates. Concerning the novel ideas, game-based assessment has proven to be an engaging and efficient method to assess applicants. It is no longer acceptable to have simple…

A Beginner’s Guide to Encryption and Data Protection

Introduction With the rise of technology in our lives today privacy of personal and sensitive information is of paramount importance. Today’s threat landscape is becoming really complex and that is why it is critical to learn about encryption and data protection. In this guide, you’ll learn what encryption and data protection is and the methods…

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…

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…

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…

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…

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…

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…

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…

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…

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….

The Role of Engagement Metrics in Tutorial Development

Developing a tutorial is one thing and encouraging people to work through it is quite another. This is why engagement metrics come into play! Knowledge of how users use your tutorials can be beneficial, and allow the creation of more accessible tutorial content. Okay, let’s explore the kingdom of engagement metrics and find out how…

What is SSM: A Comprehensive Guide

SSM is one of the most effective promotional strategies used by business organizations upon the desire to have an influential internet presence as well as reach out to the intended clients. Here in this complete guide, you will learn about the basics up to the more detailed and sophisticated system of SSM to enable you…