I was referring this How to get current product in phtml without registry?
$myBlock = \Magento\Framework\App\ObjectManager::getInstance()->get('Magento\Catalog\Model\Session')->getData('last_viewed_product_id');
Its work on my local devops, but not work in production. Anyone know why? I am trying to get the bundle product id by session, is there any other way can do it?