function login_setcookie($username, $user_id,$password, $life=0){
c_setcookie('auth', authcode("$username/$user_id/$password", 'ENCODE', AUTHKEY), $life);c_setcookie('auth_time', $life, $life);
c_setcookie('user', $username, $life);
}function logout_setcookie(){
c_setcookie('auth', '', -365*86400);
c_setcookie('auth_time', '', -365*86400);
c_setcookie('user', '', -365*86400);
c_setcookie('password', '', -365*86400);
return 1;
}http://lankao.soft0371.com测试账户:heartrian 密码:a123456
c_setcookie('auth', authcode("$username/$user_id/$password", 'ENCODE', AUTHKEY), $life);c_setcookie('auth_time', $life, $life);
c_setcookie('user', $username, $life);
}function logout_setcookie(){
c_setcookie('auth', '', -365*86400);
c_setcookie('auth_time', '', -365*86400);
c_setcookie('user', '', -365*86400);
c_setcookie('password', '', -365*86400);
return 1;
}http://lankao.soft0371.com测试账户:heartrian 密码:a123456
setcookie(COOKIEPRE.$name, $value, $life ? time() + $life : 0, COOKIEPATH, COOKIEDDOMAIN);
}
//cookie end
这两个常量的值是什么
Connection: close
Date: Thu, 03 Nov 2011 03:43:49 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-Powered-By: PHP/5.2.13
Content-type: text/html; charset=utf-8[BOM]array(0) {
}
array(0) {
}
1
抓包显示cookie根本没被设置。我怀疑是文件开头的三字节BOM影响了cookie的设置(cookie是在HTTP头的Set-Header里设置的,如果在设置之前就已经发送了内容,那么必然无法设置成功)。试试能否去掉ajax_lankao.php开头的三字节(用除了记事本以外的其它文本编辑器保存为UTF-8无BOM格式)
我只是上传代码到服务器,为什么会产生bom代码呢?不解,哥们你知道吗?有的服务器有,有的没有??