magento2 Invalid Form Key. Please refresh the page?












7














I am unable to save the product in magento2. it show "Invalid Form Key. Please refresh the page. in local



enter image description here



how to resolve this?










share|improve this question
























  • Please check your cookie setting
    – Amit Bera
    Feb 20 '17 at 14:56
















7














I am unable to save the product in magento2. it show "Invalid Form Key. Please refresh the page. in local



enter image description here



how to resolve this?










share|improve this question
























  • Please check your cookie setting
    – Amit Bera
    Feb 20 '17 at 14:56














7












7








7







I am unable to save the product in magento2. it show "Invalid Form Key. Please refresh the page. in local



enter image description here



how to resolve this?










share|improve this question















I am unable to save the product in magento2. it show "Invalid Form Key. Please refresh the page. in local



enter image description here



how to resolve this?







magento2 product page






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 17 '17 at 10:35









Teja Bhagavan Kollepara

2,93841847




2,93841847










asked Feb 20 '17 at 14:51









Nagaraju KasaNagaraju Kasa

2,60111438




2,60111438












  • Please check your cookie setting
    – Amit Bera
    Feb 20 '17 at 14:56


















  • Please check your cookie setting
    – Amit Bera
    Feb 20 '17 at 14:56
















Please check your cookie setting
– Amit Bera
Feb 20 '17 at 14:56




Please check your cookie setting
– Amit Bera
Feb 20 '17 at 14:56










4 Answers
4






active

oldest

votes


















13














This bug arises due to php.ini variable "max_input_vars"
Increase it to 10000 through below php function:



ini_set('max_input_vars', 10000);


OR
Using linux command line



cd /etc/php/7.0/apache2/
vi php.ini (Open for edit and set max_input_vars=10000)
:wq(Press esc and write the mentioned command to save and exit)
sudo /etc/init.d/apache2 restart(Restart Server)





share|improve this answer





















  • Thanks for you replay @ahmad vaqas khan let me check and update you thanks...
    – Nagaraju Kasa
    Apr 21 '17 at 8:29










  • ok. keep updated regarding it.
    – Ahmad Vaqas Khan
    Apr 21 '17 at 10:48










  • The above answer is worked for me thanks.
    – shivashankar m
    Jul 7 '17 at 11:37












  • It worked for me. Very interesting though. How did you debug that?
    – Abhishek Jakhotiya
    Aug 7 '17 at 13:53










  • @AbhishekJakhotiya : Great . I googled and came across this useful info . Often being PHP Core deveoper is quite helpful along with Magento developer .
    – Ahmad Vaqas Khan
    Aug 7 '17 at 17:59



















2














If you are running this Magento site on a local machine (local host) as your question seems to indicate, you may have trouble using the:
http://localhost/ syntax, as Magento 2 doesn't fully know how to deal with cookie.



Instead, I'd recommend using http://127.0.0.1/ to access the local site; in this case your browser should be able to recognize this more easily and work with Magento's cookies properly.



You may need to set a cookie domain in the admin area of Magento.



I hope this helps...






share|improve this answer





























    0














    setting max_input_vars to 10000 in php.ini resolved my issue.






    share|improve this answer





























      0














      Have you tried using different browser? I usually use Google Chrome but came across this problem, setting max_input_vars to higher values didn't help, neither using local IP address instead of localhost, but I tried using Firefox and it worked.






      share|improve this answer








      New contributor




      Máté Dusik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.


















      • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
        – Murtuza Zabuawala
        yesterday










      • I guess it denepnds on the wording then. "using firefox instead of google chrome solved my issue." could be the right variant of my answer like a previous one right? I wanted to express myself in more detailed way and telling I've tried previous answers and they didn't work for me - it's not just a hunch. It is a possible solution (like the other answer that didn't work for me - they could work for some others though).
        – Máté Dusik
        5 hours ago











      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "479"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f160829%2fmagento2-invalid-form-key-please-refresh-the-page%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      13














      This bug arises due to php.ini variable "max_input_vars"
      Increase it to 10000 through below php function:



      ini_set('max_input_vars', 10000);


      OR
      Using linux command line



      cd /etc/php/7.0/apache2/
      vi php.ini (Open for edit and set max_input_vars=10000)
      :wq(Press esc and write the mentioned command to save and exit)
      sudo /etc/init.d/apache2 restart(Restart Server)





      share|improve this answer





















      • Thanks for you replay @ahmad vaqas khan let me check and update you thanks...
        – Nagaraju Kasa
        Apr 21 '17 at 8:29










      • ok. keep updated regarding it.
        – Ahmad Vaqas Khan
        Apr 21 '17 at 10:48










      • The above answer is worked for me thanks.
        – shivashankar m
        Jul 7 '17 at 11:37












      • It worked for me. Very interesting though. How did you debug that?
        – Abhishek Jakhotiya
        Aug 7 '17 at 13:53










      • @AbhishekJakhotiya : Great . I googled and came across this useful info . Often being PHP Core deveoper is quite helpful along with Magento developer .
        – Ahmad Vaqas Khan
        Aug 7 '17 at 17:59
















      13














      This bug arises due to php.ini variable "max_input_vars"
      Increase it to 10000 through below php function:



      ini_set('max_input_vars', 10000);


      OR
      Using linux command line



      cd /etc/php/7.0/apache2/
      vi php.ini (Open for edit and set max_input_vars=10000)
      :wq(Press esc and write the mentioned command to save and exit)
      sudo /etc/init.d/apache2 restart(Restart Server)





      share|improve this answer





















      • Thanks for you replay @ahmad vaqas khan let me check and update you thanks...
        – Nagaraju Kasa
        Apr 21 '17 at 8:29










      • ok. keep updated regarding it.
        – Ahmad Vaqas Khan
        Apr 21 '17 at 10:48










      • The above answer is worked for me thanks.
        – shivashankar m
        Jul 7 '17 at 11:37












      • It worked for me. Very interesting though. How did you debug that?
        – Abhishek Jakhotiya
        Aug 7 '17 at 13:53










      • @AbhishekJakhotiya : Great . I googled and came across this useful info . Often being PHP Core deveoper is quite helpful along with Magento developer .
        – Ahmad Vaqas Khan
        Aug 7 '17 at 17:59














      13












      13








      13






      This bug arises due to php.ini variable "max_input_vars"
      Increase it to 10000 through below php function:



      ini_set('max_input_vars', 10000);


      OR
      Using linux command line



      cd /etc/php/7.0/apache2/
      vi php.ini (Open for edit and set max_input_vars=10000)
      :wq(Press esc and write the mentioned command to save and exit)
      sudo /etc/init.d/apache2 restart(Restart Server)





      share|improve this answer












      This bug arises due to php.ini variable "max_input_vars"
      Increase it to 10000 through below php function:



      ini_set('max_input_vars', 10000);


      OR
      Using linux command line



      cd /etc/php/7.0/apache2/
      vi php.ini (Open for edit and set max_input_vars=10000)
      :wq(Press esc and write the mentioned command to save and exit)
      sudo /etc/init.d/apache2 restart(Restart Server)






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Apr 21 '17 at 7:31









      Ahmad Vaqas KhanAhmad Vaqas Khan

      620616




      620616












      • Thanks for you replay @ahmad vaqas khan let me check and update you thanks...
        – Nagaraju Kasa
        Apr 21 '17 at 8:29










      • ok. keep updated regarding it.
        – Ahmad Vaqas Khan
        Apr 21 '17 at 10:48










      • The above answer is worked for me thanks.
        – shivashankar m
        Jul 7 '17 at 11:37












      • It worked for me. Very interesting though. How did you debug that?
        – Abhishek Jakhotiya
        Aug 7 '17 at 13:53










      • @AbhishekJakhotiya : Great . I googled and came across this useful info . Often being PHP Core deveoper is quite helpful along with Magento developer .
        – Ahmad Vaqas Khan
        Aug 7 '17 at 17:59


















      • Thanks for you replay @ahmad vaqas khan let me check and update you thanks...
        – Nagaraju Kasa
        Apr 21 '17 at 8:29










      • ok. keep updated regarding it.
        – Ahmad Vaqas Khan
        Apr 21 '17 at 10:48










      • The above answer is worked for me thanks.
        – shivashankar m
        Jul 7 '17 at 11:37












      • It worked for me. Very interesting though. How did you debug that?
        – Abhishek Jakhotiya
        Aug 7 '17 at 13:53










      • @AbhishekJakhotiya : Great . I googled and came across this useful info . Often being PHP Core deveoper is quite helpful along with Magento developer .
        – Ahmad Vaqas Khan
        Aug 7 '17 at 17:59
















      Thanks for you replay @ahmad vaqas khan let me check and update you thanks...
      – Nagaraju Kasa
      Apr 21 '17 at 8:29




      Thanks for you replay @ahmad vaqas khan let me check and update you thanks...
      – Nagaraju Kasa
      Apr 21 '17 at 8:29












      ok. keep updated regarding it.
      – Ahmad Vaqas Khan
      Apr 21 '17 at 10:48




      ok. keep updated regarding it.
      – Ahmad Vaqas Khan
      Apr 21 '17 at 10:48












      The above answer is worked for me thanks.
      – shivashankar m
      Jul 7 '17 at 11:37






      The above answer is worked for me thanks.
      – shivashankar m
      Jul 7 '17 at 11:37














      It worked for me. Very interesting though. How did you debug that?
      – Abhishek Jakhotiya
      Aug 7 '17 at 13:53




      It worked for me. Very interesting though. How did you debug that?
      – Abhishek Jakhotiya
      Aug 7 '17 at 13:53












      @AbhishekJakhotiya : Great . I googled and came across this useful info . Often being PHP Core deveoper is quite helpful along with Magento developer .
      – Ahmad Vaqas Khan
      Aug 7 '17 at 17:59




      @AbhishekJakhotiya : Great . I googled and came across this useful info . Often being PHP Core deveoper is quite helpful along with Magento developer .
      – Ahmad Vaqas Khan
      Aug 7 '17 at 17:59













      2














      If you are running this Magento site on a local machine (local host) as your question seems to indicate, you may have trouble using the:
      http://localhost/ syntax, as Magento 2 doesn't fully know how to deal with cookie.



      Instead, I'd recommend using http://127.0.0.1/ to access the local site; in this case your browser should be able to recognize this more easily and work with Magento's cookies properly.



      You may need to set a cookie domain in the admin area of Magento.



      I hope this helps...






      share|improve this answer


























        2














        If you are running this Magento site on a local machine (local host) as your question seems to indicate, you may have trouble using the:
        http://localhost/ syntax, as Magento 2 doesn't fully know how to deal with cookie.



        Instead, I'd recommend using http://127.0.0.1/ to access the local site; in this case your browser should be able to recognize this more easily and work with Magento's cookies properly.



        You may need to set a cookie domain in the admin area of Magento.



        I hope this helps...






        share|improve this answer
























          2












          2








          2






          If you are running this Magento site on a local machine (local host) as your question seems to indicate, you may have trouble using the:
          http://localhost/ syntax, as Magento 2 doesn't fully know how to deal with cookie.



          Instead, I'd recommend using http://127.0.0.1/ to access the local site; in this case your browser should be able to recognize this more easily and work with Magento's cookies properly.



          You may need to set a cookie domain in the admin area of Magento.



          I hope this helps...






          share|improve this answer












          If you are running this Magento site on a local machine (local host) as your question seems to indicate, you may have trouble using the:
          http://localhost/ syntax, as Magento 2 doesn't fully know how to deal with cookie.



          Instead, I'd recommend using http://127.0.0.1/ to access the local site; in this case your browser should be able to recognize this more easily and work with Magento's cookies properly.



          You may need to set a cookie domain in the admin area of Magento.



          I hope this helps...







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 20 '17 at 17:16









          Jeff FinkelsteinJeff Finkelstein

          59527




          59527























              0














              setting max_input_vars to 10000 in php.ini resolved my issue.






              share|improve this answer


























                0














                setting max_input_vars to 10000 in php.ini resolved my issue.






                share|improve this answer
























                  0












                  0








                  0






                  setting max_input_vars to 10000 in php.ini resolved my issue.






                  share|improve this answer












                  setting max_input_vars to 10000 in php.ini resolved my issue.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 11 '18 at 12:05









                  Kalyan Chakravarthi VKalyan Chakravarthi V

                  4051418




                  4051418























                      0














                      Have you tried using different browser? I usually use Google Chrome but came across this problem, setting max_input_vars to higher values didn't help, neither using local IP address instead of localhost, but I tried using Firefox and it worked.






                      share|improve this answer








                      New contributor




                      Máté Dusik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.


















                      • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
                        – Murtuza Zabuawala
                        yesterday










                      • I guess it denepnds on the wording then. "using firefox instead of google chrome solved my issue." could be the right variant of my answer like a previous one right? I wanted to express myself in more detailed way and telling I've tried previous answers and they didn't work for me - it's not just a hunch. It is a possible solution (like the other answer that didn't work for me - they could work for some others though).
                        – Máté Dusik
                        5 hours ago
















                      0














                      Have you tried using different browser? I usually use Google Chrome but came across this problem, setting max_input_vars to higher values didn't help, neither using local IP address instead of localhost, but I tried using Firefox and it worked.






                      share|improve this answer








                      New contributor




                      Máté Dusik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.


















                      • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
                        – Murtuza Zabuawala
                        yesterday










                      • I guess it denepnds on the wording then. "using firefox instead of google chrome solved my issue." could be the right variant of my answer like a previous one right? I wanted to express myself in more detailed way and telling I've tried previous answers and they didn't work for me - it's not just a hunch. It is a possible solution (like the other answer that didn't work for me - they could work for some others though).
                        – Máté Dusik
                        5 hours ago














                      0












                      0








                      0






                      Have you tried using different browser? I usually use Google Chrome but came across this problem, setting max_input_vars to higher values didn't help, neither using local IP address instead of localhost, but I tried using Firefox and it worked.






                      share|improve this answer








                      New contributor




                      Máté Dusik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      Have you tried using different browser? I usually use Google Chrome but came across this problem, setting max_input_vars to higher values didn't help, neither using local IP address instead of localhost, but I tried using Firefox and it worked.







                      share|improve this answer








                      New contributor




                      Máté Dusik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      share|improve this answer



                      share|improve this answer






                      New contributor




                      Máté Dusik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      answered yesterday









                      Máté DusikMáté Dusik

                      1




                      1




                      New contributor




                      Máté Dusik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





                      New contributor





                      Máté Dusik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






                      Máté Dusik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.












                      • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
                        – Murtuza Zabuawala
                        yesterday










                      • I guess it denepnds on the wording then. "using firefox instead of google chrome solved my issue." could be the right variant of my answer like a previous one right? I wanted to express myself in more detailed way and telling I've tried previous answers and they didn't work for me - it's not just a hunch. It is a possible solution (like the other answer that didn't work for me - they could work for some others though).
                        – Máté Dusik
                        5 hours ago


















                      • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
                        – Murtuza Zabuawala
                        yesterday










                      • I guess it denepnds on the wording then. "using firefox instead of google chrome solved my issue." could be the right variant of my answer like a previous one right? I wanted to express myself in more detailed way and telling I've tried previous answers and they didn't work for me - it's not just a hunch. It is a possible solution (like the other answer that didn't work for me - they could work for some others though).
                        – Máté Dusik
                        5 hours ago
















                      This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
                      – Murtuza Zabuawala
                      yesterday




                      This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
                      – Murtuza Zabuawala
                      yesterday












                      I guess it denepnds on the wording then. "using firefox instead of google chrome solved my issue." could be the right variant of my answer like a previous one right? I wanted to express myself in more detailed way and telling I've tried previous answers and they didn't work for me - it's not just a hunch. It is a possible solution (like the other answer that didn't work for me - they could work for some others though).
                      – Máté Dusik
                      5 hours ago




                      I guess it denepnds on the wording then. "using firefox instead of google chrome solved my issue." could be the right variant of my answer like a previous one right? I wanted to express myself in more detailed way and telling I've tried previous answers and they didn't work for me - it's not just a hunch. It is a possible solution (like the other answer that didn't work for me - they could work for some others though).
                      – Máté Dusik
                      5 hours ago


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Magento Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f160829%2fmagento2-invalid-form-key-please-refresh-the-page%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      1300-talet

                      1300-talet

                      Display a custom attribute below product name in the front-end Magento 1.9.3.8