is_user_logged_in() ? strange results




Wordpress LScache Plugin: is_user_logged_in() ? strange results

Last Updated on: Wed, 15 Apr 2026 00:00:02
Im working on a site whereby logged in subscribers can view certain content, using the is_user_logged_in() function. The homepage for instance shows different content when a user is logged in. Once logged in, the user will see the same logged out version of the homepage, until they navigate to a page that is only available to logged in users. 1. User logs in -> visits homepage, sees non-logged in version of homepage 2. User visits a users-only page (a page not accessible to non-users at all) 3. User then goes back to homepage, sees logged-in (correct) version of the homepage Its as if the user needs to visit the users-only page in order for is_user_logged_in to be triggered across the rest of the site. This happens whether Cache Logged-in Users option is switched on or off. I couldnt find the same topic covered anywhere else on here so far ? any help appreciated! I thought I should follow up on this in case anyone finds themselves in the same quandary. It looks like the problem wasnt with Litespeed Cache but with a setting within another plugin ? Id altered Heartbeat settings in Optimisation.io (to post edit screens only disabled everywhere else) This seems to have fixed the issue I was having. Oh, good, glad you got it figured out! Thanks for sharing the solution here.



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference