Session丢失的几种解决方法

1、改成使用cookie

2、把<sessionState    mode设置成StateServer就ok了,我也不知道什么原因。 

 1<!--  会话状态设置
 2          默认情况下,ASP.NET 使用 Cookie 来标识哪些请求属于特定的会话。
 3          如果 Cookie 不可用,则可以通过将会话标识符添加到 URL 来跟踪会话。
 4         若要禁用 Cookie,请设置 sessionState cookieless="true"。
 5    -->
 6    <sessionState 
 7            mode="StateServer"
 8            stateConnectionString="tcpip=127.0.0.1:42424"
 9            sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
10            cookieless="false" 
11            timeout="40" 
12    />

3、使用SqlServer保存Session

4、让杀毒软件不扫描bin文件夹下的文件和Web.Config文件 。

5、定时刷新页面,不让Session丢失。

posted on 2006-04-12 14:20    阅读(602)  评论(0编辑  收藏  举报

导航