bool setcookie ( string name [, string value [, int expire [, string path [, string domain [, int secure]]]]])
path:
If set to '/', the cookie will be available within the entire domain. If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.

解决方案 »

  1.   

    在设定cookie的时候,有两点情况可能会导致楼主的问题.
    1、在设定cookie的时候加了路径,含路径的cookie是不能随便被清空的。
    2、php的cookie传递比较慢,清空后不会马上消失,你再刷新一下看看,也许就可以了。
      

  2.   

    setookie('aa','1');未添加 path。如何处理?