SessionState Timeout never fires

谁说胖子不能爱 提交于 2019-12-11 12:23:26

问题


What am I doing wrong. The sessionState Timeout never fires,It only fires after 24 hours, I want to let it fire in 20 minutes on my webpage. In the web.config I handle the sessionstate like this:

<sessionState cookieless="false" mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424"
    sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
    timeout="1" stateNetworkTimeout="1"/>

timeout="1" is on purpose, for testing. And in the code I check on which session I am by calling Session.SessionID.ToString()


回答1:


if you're using InProc, you dont need stateConnectionString, sqlConnectionString and stateNetworkTimeout. Try removing these, and see if this works as you'd like.




回答2:


SessionState Timeout only fires when session state mode is InProc.




回答3:


I've figured out that if I change cookieless=false -> true that it works , but now the sessionid is shown in my URL. How could I get rid of the sessionid in my url. its like http://domain.com/(S(nvqmpm45j2fnnc21w00sjx55))/index.aspx



来源:https://stackoverflow.com/questions/4284673/sessionstate-timeout-never-fires

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!