We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [form-key]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
19
votes
1answer
34k views

What is getBlockHtml('formkey')?

I am trying to edit the product edit page (first tab) in Magento and would like to move the quantity (as well as a few other things) from their respective tabs up to the first page. I see <form ...
18
votes
8answers
48k views

“invalid form key. please refresh the page” - cannot login to admin panel

I regularly visit my site to make sure its working and noticed that images for products were not appearing, thinking it was a problem with indexing cache I tried to login to the admin panel and ...
18
votes
3answers
24k views

Getting correct FormKey

I have a page that I listed products, that's it. Its kind of catalog/view.phtml clone. Just included app/Mage.php. In this page I use Mage::getSingleton('core/session')->getFormKey(); but it's ...
12
votes
3answers
14k views

Magento 2 - What is the use of formkey

I see this line of code inside the login form. <?php echo $block->getBlockHtml('formkey'); ?> What is the use of it? Is it more secure? Is it a must for form post?
10
votes
1answer
2k views

Frontend form key is being overwritten

I am currently having issues with frontend forms where the form keys are somehow being overwritten and displaying incorrect form keys. I am currently debugging this issue on the customer login form. ...
8
votes
11answers
55k views

Error - Invalid Form Key

I meet a problem with magento 1.9.2.3, an error message appears when I connect with my custom admin form. I created a module and I duplicated the customer/account/login page for my users role. <?...
7
votes
1answer
1k views

What is the form_key used for?

I really don't understand the form_key feature. I have found several sites asking and dealing with issues about the form_key but none explained the reason for it's existence. Everyone just worked ...
7
votes
2answers
3k views

Undefined index: form_key in … downloader/Maged/Model/Session.php on line 252

After applying patch SUPEE-6285 on Magento 1.9.1.0, I am seeing the following error in system.log several times a day: Undefined index: form_key in ... downloader/Maged/Model/Session.php on line ...
6
votes
2answers
7k views

After applying SUPEE-6788 can't create customer

After installing the patch, customers are unable to register accounts.
6
votes
2answers
13k views

Form Key Value in template and controller

The following function is used to get the form key in templates with type hidden. My customerController.php does not validate the form key with the method _validateFormKey(). When I echo the following ...
6
votes
7answers
7k views

Form Key Error when removing a product from Mini cart

So this is a problem that I have been trying to solve for a few days now. I'm not an expert at this, but I manage quite a bit through googling and testing myself. My website is more or less ready to ...
5
votes
1answer
2k views

Cache blocks that contain form_key (i.e. dynamic content)

I wonder, if there is a best practice to use block caching for blocks that contain a form with the form_key input (CSRF token). I am not talking about full page cache hole punching, but the standard ...
5
votes
4answers
1k views

Magento 2.2.4 Customer are unable to logout

i´ve just installed a fresh Magento2 on my webspace to prepare the migration of my Magento 1.9. I installed my theme (Infortis) and created my products and did the first test-salse. Everything fine......
4
votes
2answers
4k views

Why Form Key is added in every page In Magento 2

Why Form Key is added in every page In Magento 2 as a hidden input type. <input type="hidden" value="dEOXfL0kxDc8W4Yt" name="form_key"> I observed how it is generated. Is there any specific ...
4
votes
3answers
3k views

Magento 2.3 — Invalid Form Key. Please refresh the page

Getting Invalid Form Key. Please refresh the page error not able to do any action after upgrade of Magento 2.2.5 to Magento 2.3.
4
votes
3answers
3k views

External Request - Invalid Form Key Magento 2.3

I sent a “POST” request via external server for version magento-2.3 My internal Magento URL cannot verify and response is "Invalid Form Key. Please refresh the page." as a summary, i want to ...
4
votes
2answers
1k views

Initial Form Key not Matching with Varnish/Turpentine in Firefox

I'm running into a weird issue with Varnish, Turpentine, and Firefox which is, in all likelihood, something very specific to the configuration of the system I'm working on. I'm asking about it here ...
4
votes
2answers
1k views

Form Key Problems After Changing Domains 1.9.2.1

After changing domains, from dev.mysite.com to mysite.com I can no longer login to the backend, I am getting below error: Invalid Form Key. Please refresh the page. Also, Customers cannot sign in ...
4
votes
0answers
69 views

Invalid form key. please refresh the page. Discount code and Paypal review

This one seems different to all the previous questions about this error message. I'm getting the following message "Invalid form key. please refresh the page." when trying to enter a discount code or ...
3
votes
4answers
4k views

Magento 2 Form key

if (!$this->_validateFormKey()) { // do something } Any Magento 1 equivalent in Mangento 2 for _validateFormKey function. And Can anyone explain how and where Magento checks formkey, when any form ...
3
votes
1answer
1k views

Magento form key invalid after page becomes inactive for extended period of time

Running a recently upgraded instance of Magento CE 1.9.1.0 (from 1.7.0.2). Form key support was built in to the theme and is functioning a-okay when browsing the website with different browsers and ...
3
votes
2answers
2k views

Magento2.3 Product Add to Wishlist Invalid Form Key. Please refresh the page?

I am using php 7.2.13 version and magento 2.3 latest version in xampp. When i do add to wishlist and save anything am getting Invalid Form Key. Please refresh the page? this error.
3
votes
0answers
410 views

Magento 1.9.0.1 add a product to the cart by URL from external site? [closed]

I need to add multiple products from an external site to a Magento store. The stores sells cake decorations and they wan't to create recipes in their Wordpress blog, and with a simple press of a ...
2
votes
3answers
497 views

Magento admin custom form with multiple entry

I have a custom form in Magento admin. When I submit the form with multiple click of the save button the multiple entry are inserted in my table, even if I have a form key. if ($data = $this->...
2
votes
1answer
248 views

Error 404 after update to 1.9.2.0 - during registration

After update to 1.9.2.0 I have added the form-key to my registration template. I can see the form-key value using firebug on the registration page, but when I submit the form, I get a 404 error: ...
2
votes
1answer
88 views

I've just applied SUPEE-9767 to a Magento 1.6.2.0 site and there is no formkey option to enable. How has this happened and how can I fix it please?

I have applied the SUPEE-9767 patch for the correct version (1.6.2.0) of Magento and in the admin area, I can see the warning at the top of the page, indicating that the patch was successful. However,...
2
votes
1answer
208 views

magento subdomain website $this->getRequest()->isPost() return blank in every form submission

I have magento website in domain and also in sub domain. The domain website form work correctly i.e. $this->getRequest()->isPost() return true after form submission. But the subdomain website ...
2
votes
1answer
350 views

Form Key Validation Error

So I have fixed my form key validation issues but my admin is still showing an error message. Important: Formkey validation on checkout disabled. This may expose security risks. We strongly ...
2
votes
2answers
3k views

Magento 1.9 can't add items to shopping cart Form key problem

I have several Magento stores hosted on bluehost. They had been running well for a couple of months and then suddenly one day the customers just could not add products to the shopping cart any more. ...
2
votes
1answer
286 views

SUPEE 7405: Add Form Key to sidebar/default.phtml

After installing SUPEE 7405 my custom theme Sidebar Cart stopped deleting products. When delete button is clicked, throws an error: "Cannot remove the product". Looks like I need to add Form Key to ...
2
votes
1answer
338 views

mini log-in form does not log in

I put a mini-login block in the left column of home. But when I am trying to log-in from there, it takes me to the log-in page with no errors. In my search, I have seen that we should use a variable ...
2
votes
0answers
10 views

Why did the Payment section stopped working after switching primary domain? And - does Form Key Validation On Checkout need to be enabled?

Porto theme I switched the primary domain in our Magento 1.9.4 store and then the Payment section of the checkout stopped working altogether - you could select a Payment method by placing a tick in ...
2
votes
0answers
75 views

Magento 1.7 OnepageCheckout SaveBilling returns 200 -> nothing happens

When I click on the continue button inside the billing section, the tiny loading icon appears and a request is triggered. It returns 200 with an empty response. But then... nothing happens and there ...
2
votes
0answers
771 views

Magento 2 : Invalid Form Key. Please refresh the page

I get this error when I try to save a category, Invalid Form Key. Please refresh the page. I tried the following solutions from various other posts Increase php_value max_input_vars 75000 Try to ...
2
votes
0answers
1k views

Shopping cart always “empty” after 1.9.3.4 upgrade

I have upgraded magento to 1.9.3.4 via magento connect from 1.9.3.3 and now whenever I try to add a product to the cart it says shopping cart empty. I added <?php echo $this->getBlockHtml('...
1
vote
5answers
8k views

How to send a form key with post data using ajax to a controller in magento?

Suppose I have an ajax function like this in a separate js file jQuery.ajax({ url: "/package/module/index/index", type: "POST", data: {name: user_name, dob: date_of_birth},//here i want ...
1
vote
1answer
1k views

Form_key cookie in magento 2

I see that in magento 2 form_key is set in cookies. Is this cookie present in every page?
1
vote
1answer
3k views

Bypass Magento's form key usage to allow simple product to be added to cart

Magento CE 1.9.0.1 Just upgraded from CE 1.7 and our links that we previously used to add products to cart no longer work. Examples: http://www.website.com/checkout/cart/add?product=215&qty=1 ...
1
vote
1answer
96 views

Magento 2 - What's the purpose of Formkey Validator?

I want to know what does the formkey validator do : Magento\Framework\Data\Form\FormKey\Validator
1
vote
1answer
145 views

CE v1.9.3.4 (v2) did NOT fix the “Enable Form Key Validation On Checkout” Was released July 12,2017

@Ryan-hoerr YESTERDAY sent out message that there was v2 Patch or upgrade to v1.9.3.4 from v1.9.3.3 because of the form_key checkout problem which the Magento CE 1.9.3.4 Release Notes was supposed to ...
1
vote
1answer
41 views

magento 1.8 user Login not working and in Login page " /> code displayed

User login not working and it not displayed error message also. And the following code will shows " /> in login page, chechout page <?php echo $this->getBlockHtml('formkey'); ?> Already i ...
1
vote
1answer
5k views

Magento admin login Error : invalid form key. please refresh the page

I am new to magento. I have recently setup my site on magento. Today I was trying to increase the logout time frame for admin session as it used to logout in few seconds. As I tried to save the time ...
1
vote
1answer
652 views

How can I bypass _validateFormKey securely?

I am allowing WordPress to load Magento widgets by overriding Mage_Widget_Adminhtml_Widgetcontroller as shown below. I'm ensuring that a user is logged in as admin, but am I opening up myself to ...
1
vote
2answers
3k views

Get customer login form key

I want create login functionality outside magento, but same server. For this I created a login form, but without correct form key it is useless. Is there way to get customer login form key? Here is ...
1
vote
1answer
1k views

Edit Customer Address Form's Name Fields

I am editing the layout of my edit.phtml in template/customer/address/, i have edited the layout and labels of some fields there, no problem. Except, i have 3 fields in the code which i can't edit ...
1
vote
0answers
81 views

Magento 2.3.2, Amazon Sales Channel: Invalid security or form key. Please refresh the page

I have installed amazon sales channel v2 for magento 2.3.2 store. Now when I try to click 'Connect to amazon store' from 'Setup Amazon Store' section, I'm getting error 'Invalid security or form key....
1
vote
1answer
1k views

Magento upgrade to 1.9.3.4 - is forms working without form_key output in templates

I've just upgraded to Magento v1.9.3.4 and have Enabled Form Key Validation On Checkout as recommended. Magento also advices: Important! Enabling this option means that your custom templates used ...
1
vote
2answers
717 views

Error with Form Key Validation on logout

I just enabled form key validation and there's an error showing up on logout: My Magento version is 1.9.2.2 with last patch 9767 applied Invalid method Mage_Core_Model_Session::renewFormKey(Array ( )...
1
vote
1answer
127 views

Varnish cached Page without Magento hit

We're using Varnish as Page Cache, but we need to make a Ajax-Request on every page view to load the dynamic Stuff. In our case it's: global messages mini Cart form key We reduced the amount of ajax ...
1
vote
3answers
568 views

Invalid form key data - cannot login

I just downloaded and installed the Full Release of Magento Community - ver 1.9.2.4, but I can't login in backend and frontend. The error message is: Invalid Form Key. Please refresh the page. ...