ASP.Net Session Timeout: Why 20 minutes used as default?

随声附和 提交于 2019-12-20 06:28:11

问题


In ASP.Net the default Session Timeout is set to 20 minutes. Why so? Is there any specific reason behind it?


回答1:


It should not be set higher than 20 minutes (except in special cases) because every open session is holding onto memory.

From Session.Timeout on MSDN site
Note they also give an explanation for the minimum

It should also not be set lower than 4 minutes because clients rarely respond within that time resulting in a loss of session state.


Hope this helps...




回答2:


Well: 10 minutes is too fast. 30 minutes is too long. 15, 25 minutes - number is not pretty. So, they decided on 20 :P

There is no magical meaning in number 20. It is just decided to be an optimal and prettiest value for session timeouts.




回答3:


If you have fewer users, or if you save the session state to a DB, a larger timeout won't consume too many resources.



来源:https://stackoverflow.com/questions/412462/asp-net-session-timeout-why-20-minutes-used-as-default

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