Today, when I was visiting the garden, I looked at the cookies in Chrome and didn't know it.
The cookies that start with CNZZ are covered with the Chrome Developer Tools window, see the screenshot below:
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/web/Skills/
In June, a blog post--CNZZ statistical code caused bad Request-request Too Long. Six months later, it seems that CNZZ has not solved the problem.
You may ask, "Since CNZZ has this problem, why use it?" ”。 No, we didn't use CNZZ, we used Google Analytics. Some bloggers have used cnzz in their blogs.
Since CNZZ didn't solve the problem, he had to do it himself.
Workaround:
To clear all Cnzz cookies with JavaScript code, the sample code is as follows:
function Clearcnzzcookies () {
if (document.cookie.indexOf (' Cnzz ') >-1) {
var cookies = Document.cookie.split (';')
for (var i = 0; i < cookies.length i++) {
if (cookies[i].indexof (' Cnzz ') >-1) {
var cookiename = cookies[i ].split (' = ') [0];
Document.cookie = CookieName + "=deleted; expires= "+ new Date (0). toutcstring ();
Console.log (cookiename + "removed");}}}
The idea is to find all the Cnzz cookies from Document.cookie, and then modify the cookie value and let it expire immediately.
Code Run Results:
Then, Chrome is quiet.
This code has been used in the garden, when visiting the home page of the blog, if there is a CNZZ cookie will be cleared.
Author: cnblogs Dudu