Polylang Cookie
-
I read the documentation and have found the php code to implement a filter to set the cookie expiration.
I want to set the default expiration to “session” to comply with GDPR rules (since there is no way for me to block pll_language cookie before consent — Polylang creates cookie through php, not script).
I used the following php filter:
add_filter( 'pll_cookie_expiration', function() { return 0; } );
The filter works, however, when expiration is set to 0, the cookie never gets set — maybe it expires immediately instead of being set to “Session”?
What should I do?
Edit: A thing comes to my mind — maybe the pll_cookie_expiration sets the “max-age” instead of “expires” which makes it expired immediately.
Things to refer to: MDN — Cookie Attributes
- The topic ‘Polylang Cookie’ is closed to new replies.