If I used cacheable="false"
in my custom module layout file then I get customer id by using when all type of cache is enabled.
public function _construct(
\Magento\Customer\Model\Session $session
) {
$this->customerSession = $session;
}
public function abc()
{
if ($this->customerSession->isLoggedIn()) {
echo $this->customerSession->getCustomerId();
}
}
But when I upload module in the marketplace then it rejected because of cacheable="false"
so what is alternative way of cacheable="false"
to get customer id in the frontend.