Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there any disadvantage or limitations of setting maximum session out time?

In asp.net, the default session time out is 20 minutes. Suppose if i am changing the session time out period to 2 hours or greater than of its, then will it cause any performance issue on server side?

I would like to know Is there any limitations or disadvantages of using maximum session out time in asp.net?

Please guide me to get out of this issue?

like image 869
Saravanan Avatar asked Jan 02 '13 05:01

Saravanan


2 Answers

Sessions are maintained on server for each user. Increase in session time out will prevent the Server from releasing memory allocated to inactive session.

I would like to know Is there any limitations or disadvantages of using maximum session out time in asp.net?

HttpSessionState.Timeout Property

The Timeout property cannot be set to a value greater than 525,600 minutes (1 year). The default value is 20 minutes.

Disadvantage: You will have performance issues if you have large number of users and with increase in session timeout, your inactive sessions will remain in Web server memory which may cause application pool to recycle, which would result in loosing all sessions for all users.

like image 122
Habib Avatar answered Sep 28 '22 14:09

Habib


If you are you using IIS6 or greater then depending on your Application Pool settings it may affect how frequently the w3wp process is recycled. When the app pool is recycled your sessions will be lost unless you use out-of-process session state management or sql as a session state host.

If you increase the timeout to two hours individual users wont lose their session as often, but it increases the odds that all users browsing the site will occasionally get logged off when the process is recycled.

like image 45
Jeremy Thompson Avatar answered Sep 28 '22 15:09

Jeremy Thompson