I'm using a comment plugin wpDiscuz. When a guest adds a comment, the plugin adds two cookies:
comment_author_ and comment_author_email_ to remember the name and email of the user so they don't write them every time.
But then for wp-rocket this user is no longer a guest. And it stops loading the site from the cache for him. Until these two cookies are deleted, the cache does not work for him.
How do I set these cookies to lifetime 3 minutes?
In settings: Keep guest commenter credentials in browser cookies for x days
But the minimum is 1 day or 0 to clear those data when user closes browser.
Regards,
Hi @kaldata,
Please try to use the following code:
add_filter("wpdiscuz_js_options", function ($optionsJs) {
$optionsJs["storeCommenterData"] = (time() + 3 * MINUTE_IN_SECONDS) * 1000;
return $optionsJs;
});
You should add this code in the functions.php file of the current active theme.
Please don't forget to delete all caches and press CTRL+F5(twice) on the frontend before checking.
Hi, tahanks,
I tried many times. I deleted caches, pressed f5, but no result. Every time creates cookies with lifetime: Session 🙁
Hi @kaldata,
Currently, there is no solution we can provide you. However, we'll take this into consideration and may implement it in future updates if it'll be possible.