好的,我有一个 cookie 集,如果我在 Firefox 中访问私人数据,我可以清楚地看到它……好的,所以当我在某个目录的一页上回显它时,它可以工作,(www.example.com/dir),但在站点(www.example.com)的索引页面上,它不会回显,它说没有设置cookie.是的,我启用了 cookie,是的,我尝试清除缓存等等.有任何想法吗?PHP 顺便说一句
Ok I have a cookie set, and I can clearly see it if I go to private data in Firefox... ok so when I echo it on one page in a certain directory it works, (www.example.com/dir), but on the index page of the site (www.example.com), it wont echo, it says the cookie is not set. Yes I have cookies enabled, yes I tried clearing cache and all that. Any ideas? PHP btw
设置 cookie 时您在哪个目录?
Which directory are you in when the cookie gets set?
来自 PHP 手册 setcookie(),强调我的:
路径
cookie 可用的服务器上的路径.如果设置为/",cookie 将在整个域中可用.如果设置为 '/foo/',则 cookie 将仅在/foo/目录和域的所有子目录(例如/foo/bar/)中可用.默认值是设置 cookie 的当前目录.
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.
这篇关于Cookie 在不同页面上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 SELECT(MYSQL/PHP) 中加入 2 个表Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 个表)
如何使<option selected=“selected">由How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 设置?)
使用 PHP 中的数组自动填充选择框Auto populate a select box using an array in PHP(使用 PHP 中的数组自动填充选择框)
PHP SQL SELECT where like search item with multiple wordsPHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode 从 MSSQL-SELECT 产生 JSON_ERROR_UTF8json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 从 MSSQL-SELECT 产生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(),名称 ASCMySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名称 ASC)