• Hi, plugin 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?

    The Polylang plugin developer give this unswer:

    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.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author dFactory

    (@dfactory)

    Hi,

    The plugin has a built in function to check if the consent was given and it should be enough to change this line:
    if ( empty( $_COOKIE['cookies_accepted'] ) ) {

    to this:
    if ( ! cn_cookies_accepted() ) { // if cookies are not accepted

    But please take into account that from the legal point of view you don’t really need to exclude that cookie. This is a first party cookie from a self hosted functionality.

    Up to you 😉

    • This reply was modified 4 years, 1 month ago by dFactory.
    Thread Starter Ivan Gavrilov

    (@zoylander)

    Thank you for your answer!!!

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

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