如何配置session的时间?在config和iis中都可以吗?
请大家指点一下,谢谢!可以设置成永远不过期的吗?
希望大家能说的详细点,再次表示感谢

解决方案 »

  1.   

    这个倒是没有设置过,在confing文件中应该可以设置
      

  2.   

    IIS似乎是比CONFIG管用,也许是水平不够。
    想要永不过期,为什么不用COOKIE。
    当然还有一个变态的办法:
    就是在每个页面中加一个隐藏的iframe定时刷新一下
      

  3.   

    <sessionState 
        mode="[Off|InProc|StateServer|SQLServer|Custom]"
        timeout="number of minutes"
        cookieName="session identifier cookie name"
        cookieless=
             "[true|false|AutoDetect|UseCookies|UseUri|UseDeviceProfile]"
        regenerateExpiredSessionId="[True|False]"
        sqlConnectionString="sql connection string"
        sqlCommandTimeout="number of seconds"
        allowCustomSqlDatabase="[True|False]"
        useHostingIdentity="[True|False]"
        stateConnectionString="tcpip=server:port"
        stateNetworkTimeout="number of seconds"
        customProvider="custom provider name">
        <providers>...</providers>
    </sessionState>
    具体去msdn查查吧。
      

  4.   

    在刷新时间内 定时做些事情~~  这样 session就会被更新了
      

  5.   

    1,iis中可以设置session过期
    在IIS站点的属性里,在主目录->配置->会话过期时间2,config中设置:
    <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>3,也可以页面代码内直接设置:
    比如加到pageload里
    session.timeout=20