alex321
V2EX  ›  问与答

如何在后端清除 CNZZ 统计代码产生的 Cookie?

  •  
  •   alex321 · Feb 19, 2016 · 2408 views
    This topic created in 3911 days ago, the information mentioned may be changed or developed.
    CNZZ 的统计代码现在简直是无孔不入,我本地搭建的测试环境都能来上一大堆,看上去极其不爽。

    由于 CNZZ 统计代码产生的 Cookie 未设置路径,在后端直接设置 Cookie 过期时间无效。
    似乎博客园中有童鞋使用前端 javascript 脚本清除,我想知道如何在后端也做一个清除的动作,来个双保险。。
    10 replies  •  2016-02-19 15:41:08 +08:00
    qcloud
    qcloud
    Feb 19, 2016
    1
    piwik 路过
    iyaozhen
    iyaozhen
    Feb 19, 2016
    2
    清理 cookie 了会影响统计吧
    alex321
    alex321
    OP
    Feb 19, 2016
    3
    @iyaozhen 就是要不统计。。我本地的东东啊,它要统计个毛线。。
    b821025551b
    b821025551b
    Feb 19, 2016
    4
    所以本地的东西为什么要上统计代码?
    fising
    fising
    Feb 19, 2016
    5
    @alex321 貌似可以过滤的
    alex321
    alex321
    OP
    Feb 19, 2016
    6
    @fising 要怎么过滤呢?我试过设置 Cookie 的 value 为 test ,结束时间为一小时前,但这家伙没有设置 Path ,似乎不能直接操作。
    fising
    fising
    Feb 19, 2016
    7
    我错了。原来你是要清除 cookie ,按 4 楼,本地环境不插入统计代码即可
    jugelizi
    jugelizi
    Feb 19, 2016
    8
    你觉得你可以控制另外网站的 cookie ? 天啊噜
    js 在非 httponly 下可以修改 cookie 所以要么屏蔽 cnzz 的 js 代码要么后端输出 js 清除
    alex321
    alex321
    OP
    Feb 19, 2016
    9
    @fising
    @jugelizi

    我没有插入任何统计代码。。问题是另外网站的 cookie ,为毛会在我这里显示?然而 CNZZ 的就是显示出来了,还有好多个,不排除我曾经访问过添加了 CNZZ 统计代码站点。。。。。。
    那么,这些站点中的 CNZZ 的 cookie 是如何进来的?我不希望出现,自然要想办法排除掉。。
    alex321
    alex321
    OP
    Feb 19, 2016
    10
    @b821025551b 见 9 楼。或者, F12 看下是不是有很多乱七八糟的 CNZZ 的 Cookie ,比如博客园曾今因为这个被 400 了,然而博客园没有使用 CNZZ ,都是外部引入的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3014 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 11:38 · PVG 19:38 · LAX 03:38 · JFK 06:38
    ♥ Do have faith in what you're doing.