Fill the form & Get Installation Support

    If you want to remove ‘Invalid security or form key. Please refresh the page’ error message when logged in to Magento admin 2.4.x, then you need to make changes to the following file.

    Step 1 : Open the vendor file like /vendor/magento/module-backend/App/Action/Plugin/Authentication.php and override to your custom theme

    Step 2 : Find below code in the bottom section of the Authentication.php file. Approx line no. 228

    Step 3 : Replace above code with below mentioned code


    Step 4 : After change above code, please run below mentioned commands



    That’s it…

    Now logout your admin panel and again logged in and see your error now resolved…

    Fill the below form if you have any Magento programming need.

      Recent Articles

      Author Info

      Hire R. Patel

      Get a Free Quote


        mage Monkeys

        Let’s initiate a discussion!!

        Book a call

        Let our Magento expert connect to discuss your requirement.

          We offer Magento
          certified developers.

          Our Magento clientele
          is 500+.

          We sign NDA for the
          security of your projects.

          We’ve performed 100+
          Magento migration projects.

          Free quotation
          on your project.

          Three months warranty on
          code developed by us.