ie8会话问题

发布于 2024-11-09 08:05:01 字数 610 浏览 0 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森林很绿却致人迷途 2024-11-16 08:05:01

需要检查的一些事项:

您是否在响应中发送了正确的 P3P 标头?

如果您不发送 P3P 标头,IE 似乎对 Internet 区域站点上的 cookie 存在问题。您应该在每个回复中发送类似的内容:

P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"

另请参阅此处: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:

P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"

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 to IE=EmulateIE7, but your mileage may vary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文