开发者

Asp.net session storage

开发者 https://www.devze.com 2023-03-31 13:42 出处:网络
Are there any pre-conditions before storing any objects in session state. I mean when will I not be able to insert an object in session state.

Are there any pre-conditions before storing any objects in session state. I mean when will I not be able to insert an object in session state. This was an interview question that was asked to me. What could be the possible reason for not being able to 开发者_如何学编程store an object in session state?


Here are some that should be considered:

  • If it has more session data, then more memory is consumed on the web server, and that can affect performance.

  • It won't work in web garden mode, because in that mode multiple aspnet_wp.exe will be running on the same machine.

  • And if the appdomain or worker process (aspnet_wp.exe) restart/recycles very often then its not a good idea to use it

and it is gathered from here ... hope it answer your query ...


There are places in the asp.net page request life-cycle that you do not have access to the session state yet due to the lack of a valid user session such as Application_Authorize where we do not have an authenticated user yet, so Session will be null. The actual implementation of the Session store shouldn't really be a concern, neither should how the data is serialized.

0

精彩评论

暂无评论...
验证码 换一张
取 消