Instagram

About Me

Photo Profile
Meetanshi Architecture Designer

Meetanshi is found based on providing the best Magento Extensions and Customized eCommerce Business Solutions perfected to the users’ needs. Our Happy users make us Happy. Complete satisfaction to our clients is what drives and motivates us to work hard. Read More

Tuesday, November 29, 2022

How to Add Form Key in Magento 2

 Cross-site request forgery in Magento 2 can be avoided by adding a form key to the Phtml code.


According to Wikipedia, cross-site request forgery results in, 

"An attacker deceives an innocent end-user into sending a web request that they did not intend. This could result in actions being taken on the website, such as unintentional client or server data leaking, session state modification, or account manipulation.


When you add a form key in Magento 2, you protect your website from spammers trying to post to your forms from other websites pretending to be you!


By putting the solution into practice, Magento will be instructed to look for a layout block named "formkey," output it and store it for the duration of a user session.


For a programmatical solution, Visit : https://meetanshi.com/blog/add-form-key-in-magento-2/

No comments:
Write comments


Get more of our update !