Litespeed Cache unsets comments cookies




Wordpress LScache Plugin: Litespeed Cache unsets comments cookies

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi everybody. I am using the wpDiscuz plugin to replace the default comment feature of WordPress and I discovered that Litespeed Cache unsets the comment cookie. Make my site not save the information entered by the user into the comment form (such as name, email, website), everything will disappear after I reload the page. I sent support for wpDiscuz this problem, you can see here. Report number: BGRQVQIB This topic was modified 4 years, 3 months ago by Trieu Vy. The page I need help with: https://thuthuatios.com Hi, If these values are stored in cookie, then please try edit your .htaccess, add: RewriteRule . - [E=Cache-Vary:COOKIENAME] replace COOKIENAME to your cookies name. after RewriteRule . - [E=Cache-Control:no-autoflush] and see how it goes? Best regards, Hi @CacheCrawler I added the following to the .htaccess file RewriteEngine on CacheLookup on RewriteRule . - [E=Cache-Control:no-autoflush] RewriteRule . - [E=Cache-Vary:comment_author_ HASH ] RewriteRule . - [E=Cache-Vary:comment_author_email_ HASH ] RewriteRule . - [E=Cache-Vary:comment_author_url_ HASH ] But the information I entered was lost after I refreshed the page. Report number: VLNRSDOH Hi, Please remove the added code , its not solution. I found the problem. without the rewrite rule I sent you: Page is generated before the cookie is created , so regardless what value the cookie has, it will not read , as its cached already. with the rule I sent you: I just did some test, that rule means: if this cookie exists , than run PHP and creates new copy of cache. I just confirmed the rule is actually working , I can see different copies for same page with and without cookie by verifying the timestamp. However, in theory , the new-cached-copy does hit PHP first , and then store it as cache, I dont know why it doesnt read the cookie value into page. I will continue to look into this issue. Best regards, All right! I hope you will find a solution to this problem of mine. Thank you.



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



Reference