Wordpress LScache Plugin: How to log in/out users correctly?
Last Updated on: Wed, 15 Apr 2026 00:00:02 Ok, I am developing second generation custom theme for my site. I have a login/out button in the navbar utilizing wp_loginout. But this thing doesnt work. I click it from homepage, login and redirect back to homepage and there is still login button where it supposed to be log out button, also I am showing some links below the navbar using is_user_logged_in() if statement. That also doesnt appear. Please feel free to ask for any settings of lscache. I have been looking at few articles in last few hours but those dont solve the problems. This thread comes closest to the solution: https://wordpress.org/support/topic/private-caching-not-working-on-home-page/ Excluding PHPSESSID cookie works perfectly but it is mentioned there that excluding PHPSESSID from cache could have the effect of excluding many otherwise cacheable pages The guy reported that he solved his problem but didnt explain how to setup this WP Session Manage plugin and if it has any drawback. I havent found any article or anything from lscache to validate it. Help is appreciated. This topic was modified 2 years, 5 months ago by WPnerdzz. Hi, Excluding PHPSESSID which is literally disable the cache function. Have you enabled cache login user in cache setting ? also , if you are making custom theme , please consider to integrate LSCWP API in your case , you can either , create a private cache for login user , or make the that is_user_logged_in navbar (or any other user-specified content) with ESI block. Best regards, Hi, you are right, I checked response header and it was X-LiteSpeed-Cache miss I removed PHPSESSID to check it and it is showing X-LiteSpeed-Cache hit,private I logged out and logged in again and it seems to be working. Also tried user with subscriber role and that is working as well. looks like my problem is fixed. And it is probably not a good idea to hardcode Litespeed API on theme for flexibility. Hi, it is probably not a good idea to hardcode Litespeed API on theme for flexibility. you can add a condition check , check if LSCWP exists or not , if not , just skip the LSCWP related code , thats it , no compromises on flexibility Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference