Im experiencing an issue with Magento 2.1.7
I want to login users programmatically by only their email.
But after setCustomerAsLoggedIn it still shows sign in or create an account in the header.
This issue is the same as Show customer name after setCustomerAsLoggedIn()
which still hasn't been resolved.
/* Magento\Customer\Model\Customer $this->customer */ $Customer = $this->customer->loadByEmail('firstname.lastname@example.org'); /* Magento\Customer\Model\Session $this->customerSession */ $this->customerSession->setCustomerAsLoggedIn($customer);