2012-03-09 136 views
0

任何時候我更新項目中的文件,我在網站上我鬆散的身份驗證。會議正在改變,或者我不知道它會發生什麼。 我應該做什麼改變?如何在IIS或web.config中設置網站以保持會話?

氏是webconfig

<system.web> 
    <sessionState cookieless="UseCookies" mode="InProc" sqlCommandTimeout="1200" sqlConnectionString="Data Source=WINDOWS2008\SQLEXPRESS;User ID=dotnet;Password=1234" timeout="20" /> 
    <globalization culture="en-US" /> 
    <httpRuntime minFreeThreads="18" minLocalRequestFreeThreads="18" executionTimeout="1000000" maxRequestLength="1024000" requestLengthDiskThreshold="1024000" /> 
    <!-- <sessionState timeout="60" mode="InProc" />--> 
    <!-- 
    Set compilation debug="true" to insert debugging 
    symbols into the compiled page. Because this 
    affects performance, set this value to true only 
    during development. 
--> 
    <compilation debug="true" targetFramework="4.0"> 
     <assemblies> 
      <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> 
     </assemblies> 

回答

1

你應該餅乾的手段使用的身份驗證的一部分。這樣,您當前登錄的用戶不會受到會話丟失的影響。

說明:實際上,正確處理認證還有很多其他好處。對會議本身的計數有許多問題,最重要的是它不能縮放。

瞭解更多關於權ASP.NET這裏做認證: