• AleCss

    (@alecss)


    Hi, I have a plugin to prevent the cookie activation on the first visit (GDPR Cookie Compliance). It works with all the site cookies, but the pll_language. This cookie is activated also if user do not choose to activate any cookie.

    I do not want to exclude this cookie at all, I would like just to give a choice to user. How can I block it together with other cookies?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Chouby

    (@chouby)

    Hello,

    We are using standard (PHP or JS) functions to set the cookie. Please check with the author of GDPR Cookie Compliance why the Polylang cookie is activated in all cases. If there is anything wrong done on our side then I am ready to fix it. The best in that case would be that the GDPR Cookie Compliance author opens a GitHub issue to discuss the topic with me.

    Thread Starter AleCss

    (@alecss)

    I have contacted the GDPR Cookie Compliance support and paste it your message. Thank you very much for your willingness.

    Thread Starter AleCss

    (@alecss)

    Hi, the GDPR Cookie Compliance author have answer. They said this:

    I’ve checked the Polylang plugin and they’re not using filters to prevent the cookie setup. In the changelog version 1.0.2 release say: “Add the possibility not to set a cookie by defining PLL_COOKIE to false (Polylang may not work as
    expected on some pages)”.

    You’ll find the GDPR hooks and functions in the Help section, they can implement a hook in their plugin and after that you can use the GDPR hooks to create the ppl_language cookie only if the users accepted the cookies.

    The ppl_language cookie doesn’t store any sensitive information, you can to your cookie policy table and keep as it is.

    I hope this helps.

    These are the hooks they refer: https://wordpress.org/support/topic/conditional-php-script/

    Can you help me to find a solution to block pll_language? Thank you very much

    Plugin Author Chouby

    (@chouby)

    It looks like these hooks are meant to avoid scripts to be used. The issue is that Polylang doesn’t set the cookie with a script but in PHP.

    As explained by the author, the built-in way to avoid the cookie is to set the constant PLL_COOKIE to false, but this must be done rather early by the plugin.

    I guess that the plugin is setting a cookie to detect if the cookies have been accepted? Am I right?

    • This reply was modified 7 years ago by Chouby.
    Plugin Author Chouby

    (@chouby)

    Let say that it’s the case and that this cookie is named cookies_accepted. Something like:

    
    add_action( 'plugins_loaded', function() {
      if ( empty( $_COOKIE['cookies_accepted'] ) ) {
        define( 'PLL_COOKIE', false );
      }
    }, 0 );
    

    should do the trick.
    The code must be put in a plugin. It would not work in a theme.

    • This reply was modified 7 years ago by Chouby.
    Thread Starter AleCss

    (@alecss)

    Ok, thank you very much. I’ll check this with GDPR Cookie Compliance author.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘pll_language cookie’ is closed to new replies.