Support community for TTG plugins and products.
NOTICE
The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.
This forum is now closed, and exists here as a read-only archive.
You are not logged in.
Pages: 1
I just finished implementing the cookie law info plugin onto my sites via phplugins.php as discussed in this thread: http://community.theturninggate.net/top … -control/. Everything seems to be working perfectly, however, because I have three sites the user gets the banner three times, once on each site. Is there a way to make it so that if the user accepts the cookie on any one of my sites that they won't get the message again on my other sites?
Thanks,
Graceson
Graceson Aufderheide
gracesonaufderheide.com
Offline
I do not believe so. Browsers keep track of cookies based on URL, so the browser itself will not associate a cookie from my-first-domain.com with my-second-domain.com.
Offline
In case anyone else is wondering, I did figure out a way to change this. I went to cookie-law-info>js>cookielawinfo.js and then edited the code a little. I looked up the js's setcookie function and found out that if you want the cookie to be set for a domain and all subdomains too the domain of the cookie should be set with a period in front of it. So, on line 11 I added my domain after path. Here is what that line looks like now for my site:
document.cookie = name+"="+value+expires+"; path=/; domain=.gracesonaufderheide.com";
This works extremely well because once the cookie is set once on any one of my sites it is also set for the other ones too. If you were going to integrate this into the plugin it would be nice to set up a box that people would put their domain in which would then insert the code for them. However, this wouldn't work if people were using completely different domains. I found this other solution for setting a cookie on completely different domains too: https://subinsb.com/set-same-cookie-on- … t-domains. I played with it for a while, but I couldn't get it to work without redirecting the visitor to a new page momentarily. It seems like there might be some way to implement this idea if you could get the hidden images to load so that the cookie is set, but it would be nice if the page didn't have to reload. Thats about all I have figured out about this. I hope this helps someone.
Graceson
Graceson Aufderheide
gracesonaufderheide.com
Offline
Pages: 1