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

狂风中的少年 提交于 2019-12-02 09:25:21

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...

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.

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

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