Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

Hello All
I am getting this error "Invalid Form Key. Please refresh the page." whenever I try to save my product on admin panel.
I have gone through this link here but no success.
When I looked at my log file it displayed me this

2013-09-03T07:07:43+00:00 ERR (3): Notice: Undefined index: httponly  in /var/www/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 94
2013-09-03T07:07:43+00:00 ERR (3): Notice: Undefined index: secure  in /var/www/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 96
2013-09-03T07:07:43+00:00 ERR (3): Notice: Undefined index: domain  in /var/www/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 98

I commented out the lines in the file as suggested in this article here. And the errors in log files were gone. But still not able to save my product and the error "Invalid Form Key. Please refresh the page." is as it is.
I checked the post data in firebug and it showed me

form_key    THJDhxajLIZnzrHt
form_key    {{formKey}}

as form key variables passing when I save my product. When I checked it in my local machine it displays me

form_key    prvOwOCGjSKG6DpF
form_key    {{formKey}}
form_key    prvOwOCGjSKG6DpF

something like this.
Does anyone have any idea what is wrong here. Here I can see that the last value for "form_key" passing in live is "{{formkey}}" while in local it is "prvOwOCGjSKG6DpF". Any help is appreciated.

share|improve this question
add comment

2 Answers

First try disabling any custom modules that you have installed and see if the problem persists.

It looks like something is injecting an extra field in to the product page which is colliding with the form_key parameter which is used by the media uploader and and other parts of the product edit page as a nonce.

share|improve this answer
    
Hello Roscius, As you suggested I though there must be some problem with the media upload files in magento js folder. I replaced the js folder and everything works now. Thanks.. –  Jaimin Sutariya Sep 6 '13 at 7:03
add comment

Take a closer look at your .htaccess file. When I migrate my 1.7.0 Magento store to another server I included the .htaccess file from the old server and then the message: "Invalid Form Key. Please refresh the page" pop on screen and nothing happens even configuration changes had effect. The solution was to install a fresh magento and then copy the My Store files the the Magento root, excluding .htaccess. When I used the .htaccess from the fresh installation everything starts to works fine. I don´t know what exactly happens, maybe each server structure have different and particular .htaccess entries and rules. It works to me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.