I am trying to find out the session Id number.
I am using object manager for this (temporarily):
<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $objectManager->get('Magento\Customer\Model\Session'); $customerName = $customerSession->getCustomer()->getName(); ?> <div>Customer Session:<?php echo $customerSession->getCustomerId() ?></div>
Now, when I am logged in, the customer session display a number (expected behaviour), however, when I am logged out, there is no output.
My question is, should not-logged-in ("guest") customer have a session ID?