Magento 2 code sniffer showing session_id() warning
-
14-04-2021 - |
Domanda
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?
Soluzione
The principal is that you should be using Magento framework methods instead of php functions
For example
$this->setSessionId($this->session->getSessionId());
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange