2017-06-17 41 views
0

我的应用程序严重依赖于会话变量。我通过会议通过很多ids,例如Session["RecordId"] = myID。问题是会话会在几分钟内过期甚至很难我已经增加了会话变量的超时。我曾试图延长会话到期:无法增加.Net应用程序中的会话变量超时?

<sessionState mode="StateServer" cookieless="false" timeout="120"/> 

我也试图增加使用IISGlobal.asax文件超时。有没有其他的方式,或者我做错了什么?

回答

0

如果真的需要模式为StateServer的地方stateConnectionString这一

<sessionState mode="StateServer" 
    stateConnectionString="tcpip=SampleStateServer:42424" 
    cookieless="false" 
    timeout="20"/> 

否则你可以使用默认模式值是InProc

<sessionState mode="InProc" cookieless="false" timeout="120"/>