I try get custommer is login. it not success. this is my code
protected $_customerSession;
public function __construct(
...
\Magento\Customer\Model\Session $customerSession,
....
){
...
$this->_customerSession = $customerSession;
...
}
public function getCustommer()
{
if ($this->_customerSession->isLoggedIn()) {
die('islogin');
return $this->_customerSession->getCustomer();
}else{
die('not login');
}
}
result not login any help. what wrong?
or also other ways to GetCustomer isLogin. please tell me.