Here I am unable to get customer session data ($customerSession) it's working in Magento version 2.2.3 but not working 2.2.4 it return false when cacheable is false.
namespace Namespace\ModuleName\Helper;
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
public $customerSession;
public function __construct(
\Magento\Customer\Model\Session $customerSession
) {
$this->customerSession = $customerSession;
parent::__construct($context);
}
public function getCustomerGroup() {
if($this->customerSession->isLoggedIn()) {
$groups = $this->customerSession->getCustomer()->getGroupId();
return $groups;
}
return '0';
}
}