请参考:http://support.microsoft.com/default.aspx?scid=kb;en-us;Q316148

解决方案 »

  1.   

    也可以试着写进cookie阿
    或者直接传不行吗?
      

  2.   

    我想是这样吧,当生成项目时,SESSION可能清空了
      

  3.   

    是不是你的iis设置了timeout不是这个值啊?
      

  4.   

    IIS和web.config设的值必须一样吗?
    另外我在网站根目录下只放置了web.config文件,是不是还需要其他的文件
    如果需要其他文件,可不可以提供一下文件中的内容?谢谢谢谢!
      

  5.   

    it is mainly due to application recycle, seePRB: Session Data Is Lost When You Use ASP.NET InProc Session State Mode
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q324772consider to use State Server or SQL Server to store session information
      

  6.   

    thanks,but 真的只有用数据库存session变量一种方法吗?
      

  7.   

    The link I provided above suggested some causes of session losses:"....
    1. Various attributes (for example, the memoryLimit attribute) have particular settings in the <processModel> section of the configuration file.
    2. The Global.asax or the Web.config file was modified.
    3. The Bin directory of the Web application was modified.
    4. Virus scanning software touched some .config files
    ...."you should look into your application carefully to see where the problems arebesides using a database to store session states, you can also use a State Server, or actually you can write all the session information into the ViewState or hidden controls
      

  8.   

    what is the State Server?
      

  9.   

    what is the State Server?ASP.Net提供了三种保存Session的办法,一种是InProc,也就是保存在本服务器,一种是SQL Server,将Session值保存在数据库Server,第三种就是State Server,把Session保存在单独的服务器上面。
      

  10.   

    把你的machine.config也改成120看看!
      

  11.   

    machine.config没有听说过,能介绍一下此文件干嘛用的吗?