I am trying to add sign-in in the mobile menu, so I had designed the menu according to that but when in default I had given the Sign In link once he signed in I will show the My Account link. I used the Customer View Model to check the Customer logged in or not, for me after sign in also for me sign in itself showing, so I cleared the cache at backed and checked it changed to My Account after that I logged out means it still shows My Account. I had declared the block as non-cacheable but still, I am facing this problem can any guide show the menu. I used the below code to check the Customer is logged or not
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->create('Magento\Customer\Model\Session');
<?php if($customerSession->isLoggedIn() == 1): ?>
<p>Huray, you're logged in!</p>
<?php endif; ?>
<?php if(!$isCustomerLoggedIn): ?>
<p>Hey, you're not logged in!</p>
<?php endif; ?>