Visitor
Magento\Customer\Model\Visitor
What it does
The Visitor model tracks and manages visitor sessions in Magento 2, storing information about both guest visitors and logged-in customers.
Developers use this class to monitor user activity, track online customers, bind customer login/logout events, and associate visitors with shopping cart quotes.
It automatically initializes visitor data on each request and provides methods to clean up outdated visitor records.
Public Methods
- setSkipRequestLogging()
- initByRequest()
- beforeSave()
- afterSave()
- saveByRequest()
- isModuleIgnored()
- bindCustomerLogin()
- bindCustomerLogout()
- bindQuoteCreate()
- bindQuoteDestroy()
- getCleanTime()
- clean()
- getOnlineInterval()