Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Cookie comment life...
 
Notifications
Clear all

Cookie comment lifetime in seconds

5 Posts
3 Users
0 Reactions
2,265 Views
(@kaldata)
Member Customer
Joined: 9 years ago
Posts: 2
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
  [#5565]

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,



   
Quote
Elvina
(@elvina)
Support
Joined: 7 years ago
Posts: 1403
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

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.



   
ReplyQuote
(@kaldata)
Member Customer
Joined: 9 years ago
Posts: 2
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hi, tahanks, 

I tried many times. I deleted caches, pressed f5, but no result. Every time creates cookies with lifetime: Session 🙁



   
ReplyQuote
Elvina
(@elvina)
Support
Joined: 7 years ago
Posts: 1403
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@kaldata,

The code provide above work only partly.

I'm sorry but we can't provide an exact solution for that, because for the cookie we use the js lib, that allows to set cookie only by days(not hours/ minutes and etc).

 



   
ReplyQuote
Astghik
(@astgh)
Illustrious Member Admin
Joined: 8 years ago
Posts: 6645
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

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. 



   
ReplyQuote
Share:
Scroll to top