2012-07-16 151 views
0

在我的asp.net aplication我在web.config中使用这些设置会话cookie和asp.net

<sessionState mode="InProc" 
       stateConnectionString="tcpip=127.0.0.1:42424" 
       stateNetworkTimeout="10" 
       sqlConnectionString="data source=127.0.0.1;Integrated Security=SSPI" 
       sqlCommandTimeout="30" customProvider="" cookieless="UseCookies" 
       cookieName="ASP.NET_SessionId" 
       timeout="120" 
       allowCustomSqlDatabase="false" 
       regenerateExpiredSessionId="true" 
       partitionResolverType="" 
       useHostingIdentity="true"> 
    <providers> 
    <clear/> 
    </providers> 
</sessionState> 

<authentication mode="Forms"> 
    <forms loginUrl="~/login.aspx" 
     defaultUrl="Default.aspx" 
     cookieless="UseCookies"/> 
</authentication> 

但有时会站在行为怪异

得到用户http://my.appl.com/S(DGsdgfg453dsgfsdgsdgsd)/mypage.html 其中S(DGsdgfg453dsgfsdgsdgsd)用于一个用户的会话密钥,但让他所有的用户。好像UseCookies = false.

我重新启动应用程序,并有一段时间它工作良好。然后再一次。

我的应用程序有什么问题?

+0

”节点中“无cookie”的值为“true”或“false”,而不是“UseCookies”。 – 2012-07-16 12:31:27

+0

不仅http://msdn.microsoft.com/en-us/library/h6bb9cz9.aspx – 2012-07-16 12:53:09

+0

和我用“假”没有好结果 – 2012-07-16 12:56:39

回答

0

我想是因为内存已满。我在Session中保留了一个很大的序列化对象。

我的Global.asax.cs

protected void Session_End(object sender, EventArgs e) 
{ 
Session.Clear(); //? 
Session.Abandon(); 
} 

添加和问题就消失了。