0

I have custom php script located inside pub/. It doesn't use Magento objects to limit spent resources because it is called at each page load with ajax call.

Inside that script I need to check if data saved to cookie inside Magento observer is from the same Magento session or not.

In Magento 1 it was easy by using $_COOKIE['frontend']. Each time I saved data to cookie I also saved information about $_COOKIE['frontend']. When I read cookie value I also checked if $_COOKIE['frontend'] is still the same as it was when I saved the cookie information.

Now with Magento 2 there is no cookie with name frontend, I found useful cookies just cookie PHPSESSID, but this is probably not the same as Magento session id. At least with Magento 1 it was different, it could last different time as Magento session id. So how does Magento 2 check Magento session id, is in Magento 2 the same as PHPSESSID?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.