Magento 2 code sniffer showing session_id() warning
-
14-04-2021 - |
質問
After running the code sniffer on Magento 2 extension got several warnings and that includes one warning saying "The use of function session_id() is discouraged". So what is the alternative to get the session_id in Magento 2 extension?
解決
The principal is that you should be using Magento framework methods instead of php functions
For example
$this->setSessionId($this->session->getSessionId());
所属していません magento.stackexchange