Magento 2 code sniffer showing session_id() warning
-
14-04-2021 - |
Pergunta
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?
Solução
The principal is that you should be using Magento framework methods instead of php functions
For example
$this->setSessionId($this->session->getSessionId());
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange