1

I have referred this link for set session variable however I bit confused which one is adapt for my situation.

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

I am looking for carry chat session so I don't mind whether they customer or visitor, I need to give supports to both.

my question is

What is the right session to handle the session of both visitor and customer.

Bilal Usean
  • 9,977
  • 14
  • 75
  • 122
  • well according to me as there is not core session any more in magento2 you can use the customer session class to add data of the visitor – Atish Goswami May 30 '16 at 06:23
  • thanks, suppose if I use catalog session, it will affect anything? – Bilal Usean May 30 '16 at 06:29
  • Na, I don't think so, but as you are saving data regarding a visitor who can be considered as a potential customer it would be wise to store its data in the customer session, but if it would have been something related to products it would have been ok to save it in the catalog session. – Atish Goswami May 30 '16 at 06:48

0 Answers0