0

私のasp.netアプリケーションでは、web.configでそのような設定を使用しました

<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>

しかし、時々セッションの振る舞いは奇妙になります

ユーザーは、1人のユーザーのセッションのhttp://my.appl.com/S(DGsdgfg453dsgfsdgsdgsd)/mypage.html whereS(DGsdgfg453dsgfsdgsdgsd)キーを取得しますが、すべてのユーザーを取得します。かのようにUseCookies = false.

アプリケーションを再開しましたが、しばらくするとうまくいきます。また。

私のアプリケーションにはどのような問題がありますか?

4

1 に答える 1

0

その理由は、メモリがいっぱいだったと思います。私はセッションに大きなシリアル化されたオブジェクトを保持しました。

Global.asax.csに追加しました

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

そして問題は消えました。

于 2012-08-28T12:22:26.447 に答える