设置cookie的页面和访问cookie是否在同一目录下? 如果不是请在设置cookie时设置cookie的有效路径 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.
如果不是请在设置cookie时设置cookie的有效路径
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.
2、cookie默认doamin为/。即cookie在同一浏览器进程中对网站所有的页面有效
setcookie("right",mysql_result($result,0,'qx'));
setcookie("workname",mysql_result($result,0,'workname'));?>
<script language=javascript>
window.location.href='<?=$HTTP_SERVER_VARS['HTTP_REFERER'];?>';
</script>
我把生成cookie的文件放到跟目录下去了,cookie可以用了。现在的问题是我在我的机子上可以用,到别人的机子怎么也用不了啊!