setCookie 怪事,请高手出招?

简叔 简叔 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我的 Code
<?
header("content-Type: text/html; charset=utf8");
session_start();
$doc_root = "..";
include_once($doc_root."/Conf/Conf.php"); // 无任何输出
include_once($doc_root."/Lib/Functions.class.php"); // 无任何输出
$fun = new FunLib();

// check user password and get basic information
// 0_login failure
// 1_login success
// 2_not manager login
$result = $fun->get_user_info($http_vars["company_no"],strtoupper($http_vars["username"]),strtoupper($http_vars["password"]));
if ($result == 1)
{
// Login success write cookie, store the company id
setCookie("company",$http_vars["company_no"],time()+3600*24*365);
echo $_COOKIE["company"]; // 这里可以拿到值
//Header("Location: $doc_root/BasicInfo/MGRF000.php");
exit;
}
?>

在其它页面拿不到值? 为什么??




...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
简叔
基础编程 21,889 成员 140,329 内容