2012-03-09 135 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这里做认证: