I'm checking if customers are logged in with "<?php if(Mage::getSingleton('customer/session')->isLoggedIn()): ?>" for the price and the add to cart button in price.phtml, list.phtml and addtocart.phtml
No big deal so far and everything is working as it should be. Non-logged in users don't see prices and the add to cart button, logged in users do.
Now I installed Varnish (+Turpentine) and - as expected - it doesn't work anymore because it caches the above mentioned pages without respecting the customer groups "not logged in" and "logged in".
Does anybody have an idea how I could make Varnish stop caching the not-logged-in sites if a customer logs in?
Thx a lot in advance.
upgrade turpentine to latest version, and add your code to named block, then use ESI options to refresh this block on page load.