Usually, we can check whether a customer is logged in via the Customer Session (Magento\Customer\Model\Session) class. Sometimes when a full-page cache is enabled, the generic
Easy way to check whether customer logged in or not via customer Js component in phtml file. <div data-bind=”scope: ‘customer'”> <!– ko if: customer().fullname –>