2

Magento 2 has multiple session types. I know that each type gives you access to different information ie current customer information.

The sessions I know of are:

\Magento\Backend\Model\Session
\Magento\Catalog\Model\Session
\Magento\Checkout\Model\Session
\Magento\Customer\Model\Session
\Magento\Newsletter\Model\Session

What I need to know is when are these different sessions instantiated / refreshed?

I'm currently having a problem where I add data using ->setData to the Catalog Session. After adding a product to the cart this data (->getData) doesn't exist anymore. Or at least this is what seems to happen.

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.