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