我每次都在IE7中丢失会话! [英] I have lost session in IE7 every time!

查看:58
本文介绍了我每次都在IE7中丢失会话!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.Net中创建了一个项目,但遇到了一些问题.登录完成后,应用程序将会话存储在Session["login"] = 1中.
在Firefox,Chrome,Safari,Opera中,此会话始终设置为true,但是当我在IE中获取会话时,该会话不会存储并丢失.

我不明白!

帮我解决这个问题.
非常感谢.

I created a project in ASP.Net and I have some problems. When log in is done the application stores the session in Session["login"] = 1.

This session always get set to true in Firefox, Chrome, Safari, Opera but when I get session in IE the session is not stored and is lost.

I don''t understand!

Help me this problem.
Thanks a lot.

推荐答案

您遇到的问题可以通过3种方法解决,看看哪种方法最适合您.

1.在执行标题位置之前,尝试添加session_write_close()(http://nl3.php.net/manual/en/function.session-write-close.php)

2.如果使用session_set_cookie_params(604800,'''','''')设置cookie参数,则不会输入路径.有时这会给IE7带来问题

3.在您的php Header中添加以下缓存头(缓存控制:不存储,不缓存,必须重新验证,后检查= 0,预检查= 0,私有");

希望对您有所帮助.
The problem that you are experiencing can be solved in 3 ways see which one works for you.

1. Try to add session_write_close() (http://nl3.php.net/manual/en/function.session-write-close.php) before doing a header location

2. If you set your cookie params with session_set_cookie_params(604800,'''','''') you do not enter a path. This sometimes gives problems with IE7

3. Add the following cache header in you php Header("Cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, private");

Hopes this helps you.


查看以下msdn链接

http://social.msdn.microsoft.com/Forums/zh/iewebdevelopment/thread/71d0aa20-1201-420c-a8ec-adbd04680089 [
Check out the following msdn link

http://social.msdn.microsoft.com/Forums/en/iewebdevelopment/thread/71d0aa20-1201-420c-a8ec-adbd04680089[^]


更改IE设置,如下所示:工具; Internet选项;隐私;高级;始终允许会话cookie.

希望这也能解决您的问题.
change the IE setting as below , tools;Internet Options;Privacy;Advance;Always allow session cookies.

Hope this will also solve your problem.


这篇关于我每次都在IE7中丢失会话!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆