ie8会话问题
session_start();
//If user was logged in then returns true,
//if user was NOT logged in then it returns false;
//except on ie8 this returns ALWAYS false, and never true
var_dump($this->user->is_logged_in());
$_POST['username'] = 'test';//username = test
$_POST['password'] = 'test';//pass = test
var_dump($this->user->login());//bool //true/
var_dump($this->user->is_logged_in());//bool true
die();
这就是我的脚本中用于调试脚本并找出问题所在的内容...... 问题是,在“仅限 ie8”上,会话似乎不会停留,并且总是在每个请求上删除。
我还应该提到 b4 这段代码有 ob_start()
这让我发疯:(有帮助吗? 如果需要更多信息,我会添加它们。
session_start();
//If user was logged in then returns true,
//if user was NOT logged in then it returns false;
//except on ie8 this returns ALWAYS false, and never true
var_dump($this->user->is_logged_in());
$_POST['username'] = 'test';//username = test
$_POST['password'] = 'test';//pass = test
var_dump($this->user->login());//bool //true/
var_dump($this->user->is_logged_in());//bool true
die();
This is what I have on my script to debug my script and find out where the problem is...
The problem is that on "ie8 only" The sessions do not seem to stay and always keep deleting on every request.
I should also mention b4 this code there is ob_start()
This is driving me mad :( help anyone?
if more info needed I will add them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
需要检查的一些事项:
您是否在响应中发送了正确的
P3P
标头?如果您不发送 P3P 标头,IE 似乎对 Internet 区域站点上的 cookie 存在问题。您应该在每个回复中发送类似的内容:
另请参阅此处:http://msdn.microsoft.com/en-us/library/ms537343(v=VS.85).aspx
它是否适用于其他兼容模式?
我在使用 IE8 时遇到了 Cookie 问题,除非其
X-UA-Compatible
标头设置为IE=EmulateIE7
,但您的情况可能会有所不同。Some things to check:
Are you sending a proper
P3P
header on your responses?IE seems to have a problem with cookies on Internet Zone sites if you're not sending P3P headers. You should send something like this with each response:
See here also: http://msdn.microsoft.com/en-us/library/ms537343(v=VS.85).aspx
Does it work with another compatibility mode?
I've had cookie issues with IE8 unless its
X-UA-Compatible
header is set toIE=EmulateIE7
, but your mileage may vary.