문제

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

https://github.com/magento/magento2/blob/5a9fcab6a35b6b39e10f47ca1ea22dfca4b794a4/app/code/Magento/Customer/Model/Visitor.php#L178

            $this->setSessionId($this->session->getSessionId());
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top