Phpmd Error: The class uses sessions or cookies while not being a part of HTML Presentation layer in Magento 2.

In Magento 2, You are trying to commit the module with PHP Code standard tools GrumPHP and your module have an issue related to Sessions or cookies that are not used in the Presentation layer at that time you are facing the error like this,

The class uses sessions or cookies while not being a part of HTML Presentation layer.

You have to fixed PHPMD error by adding SuppressWarnings before the class name. Continue reading “Phpmd Error: The class uses sessions or cookies while not being a part of HTML Presentation layer in Magento 2.”

Add Secret Key to URLs in Magento 2.

Magento is delivering superior security to all of their clients and has been actively investigating the root cause of the reported issue and try to fix for security issue found in the system.

To prevent CSRF attacks for Magento backend you need to enable Add Secret Key to URLs, Out of the box, Magento provides this feature as enabled.

To reduce potential CSRF attacks in Magento 2 do the following steps. Continue reading “Add Secret Key to URLs in Magento 2.”