Tagged: Cookie Consent, multisite
-
AuthorPosts
-
December 5, 2019 at 1:54 pm #1162980
hi folks,
i have a problem with the value of the cookie stored for the cookie consent on multisite (not subdomain)
my structure is:
XXX.DOMAIN.XX
XXX.DOMAIN.XX/SITENAME1/
XXX.DOMAIN.XX/SITENAME2/
…so….
as in helper-privacy.php on line 1502 the variable $cookie_contents has a different value
on every subsite the cookie is overwritten on every subsite reload.
this leads to the problem that i have to accept the cookie-consent on every pageload when changing from on to another site.my questions:
– is it possible to set one identical VALUE to every site (quickly)
– can you implement a check so i have not fix that on every updategreez
rene- This topic was modified 4 years, 11 months ago by isee.
December 6, 2019 at 6:59 pm #1163439Hey rene,
Thank you for using enfold – and for reporting this.
Seems to be a not very common problem – so we will provide a filter that allows you to return a value you can customize. You can hardcode a fixed value in the fiter that is returned for all sites and when you need a new popup just change the returned value in the filter.
As a quick fix:
In helper-privacy.php line 1502 you find:
$cookie_contents = md5( $cookie_contents ) . '||v1.0';
Before this line add:
$cookie_contents = apply_filters( 'avf_cookie_consent_for_md5', $cookie_contents, $message, $buttons );
And in functions.php of your child theme add:
The filter will become part of the next update.
Hope this helps you.
If you need assistance let us know and we can do it for you.
Best regards,
GünterJanuary 14, 2020 at 5:30 pm #1173468hi günter, sorry for beeing so late with my response…
i thank you very much for your support and implementing that in 4.7 :-)for now im not sure how to really do it, i tried (very quick) like so:
function custom_avf_cookie_consent_for_md5( $cookie_contents, $message, $buttons ) { $cookie_contents = '14e61ea2d6fd3ee9851c9016aa79ba9b||v1.0'; return $cookie_contents; } apply_filters( 'avf_cookie_consent_for_md5', 'custom_avf_cookie_consent_for_md5', 10, 3 );
but tis is not enough so i have to look what to do exactly
greez
rene- This reply was modified 4 years, 10 months ago by isee.
January 14, 2020 at 6:38 pm #1173553Hi,
Can you try to use something like:
$cookie_contents = 'This is my cookie contents for all sites.';
If this does not work, can you give us wp admin backend access so we can check and try to modify the code. We might need to add some debugging output.
Best regards,
GünterJanuary 14, 2020 at 6:57 pm #1173568i will try the next days and give a feedback
May 30, 2020 at 2:53 am #1217896hello again :-)
after a long time i found time to take care of this problem.Solution:
Apply the Filter like so:function custom_avf_cookie_consent_for_md5( $cookie_contents, $message, $buttons ) { $cookie_contents = 'YOUR OWN CONTENT HERE'; return $cookie_contents; } add_filter( 'avf_cookie_consent_for_md5', 'custom_avf_cookie_consent_for_md5', 10, 3 );
I changed apply_filters to add_filter
now it works, but the content set to $cookie_contents runs again through md5( $cookie_contents ) in your helper-privacy.php / Line 1682. This causes no real problem, but its quite strange during debugging :-)
if you like you can maybe change on line 1682 from
$cookie_contents = md5( $cookie_contents ) . '||v1.0';
to
if (empty($cookie_contents)) { $cookie_contents = md5( $cookie_contents ) . '||v1.0'; }
greez
rene- This reply was modified 4 years, 5 months ago by isee.
June 9, 2020 at 1:43 pm #1220845 -
AuthorPosts
- You must be logged in to reply to this topic.