用户登录时建立Session:    Session.Add("CURRENTUSER",userInfo)
                        userInfo为保存用户信息的一个类
当用户执行程序将应用程序中的一个文件夹aaaaa改名为bbbbb之后,Session["CURRENTUSER"]丢失请高手们解释一下这是为什么,同时给个解决办法

解决方案 »

  1.   

    在global的application_error事件中。
    把Server.GetLastError().Message写入一个文件看看。
      

  2.   

    because the web application is restarted, seehttp://www.dotnetindia.com/2003/10/why_aspnet_rest.htmlWhy ASP.NET Restarts?
    For v1.1 
    -------- 
    The list for v1.1 is the same as v1, with the following new conditions: - User code called HttpRuntime.UnloadAppDomain - Any directory under the web application folder is renamed -------------------------------------------------------if session variables are  important under such situations, consider to use out-of-process session store like Session State Server or SQL Server
      

  3.   

    session的问题太多了,已经有很多人发现有很多问题,这是个复杂的问题。建议用cookie。
      

  4.   

    思归解答的很清楚了,session的丢失有很多原因,有时候杀毒软件扫描web.config以及bin目录下的文件都会导致iis重启。
      

  5.   

    这是由asp.net的内部机制绝对的,某些重要的文件是被监视的,当系统监视到文件的内容发生了修改会自动重启应用程序.
      

  6.   

    兄弟现在做的这个系统无法离开目录和文件操作,看来只能用cookie了