加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – Cookies不能在不同的页面上工作

发布时间:2020-12-13 17:34:21 所属栏目:PHP教程 来源:网络整理
导读:好的,我有一个cookie集,我可以清楚地看到,如果我在Firefox中的私人数据…好的,所以当我回覆在一个页面上的某个目录,它的工作,(www.example.com/dir),但是在网站的索引页(www.example.com)上,它不会回显,它表示Cookie未设置.是的,我启用了cookies,是的,我尝试
好的,我有一个cookie集,我可以清楚地看到,如果我在Firefox中的私人数据…好的,所以当我回覆在一个页面上的某个目录,它的工作,(www.example.com/dir),但是在网站的索引页(www.example.com)上,它不会回显,它表示Cookie未设置.是的,我启用了cookies,是的,我尝试清除缓存和所有这些.有任何想法吗? PHP btw
当cookie设置时,你在哪个目录?

从PHP manual on setcookie()年,重点在于:

Path

The path on the server in which the cookie will be available on. 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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读