Are Session Variables in ASP.Net MVC Industry standard? -


i writing database app returns recordsets controller. reuse them because static data, (based on user, different every user), , resort/search needed using linq based on multiple requests user.

in past, session variables highly frowned upon, taboo, in asp.net mvc because 1 of benefits of technology was supposed fire , forget. seeing more people suggesting using session variables hold recordsets.

is standard now, or there better way handle multiple requests use same recordsets? example, should make local service hold data service asp.net mvc application? else?

in general, session frowned upon because of limitations. instance, it's highly serialized , can impact performance, although using attributes make session read-only can improve that. issue session volatile, , can literally go away whenever iis wants more memory. it's not secure, nor should used secure.

a better option might using asp.net cache store data, or httpcontext.items array if need on per request basis.

session scaling issue, if need expand multiple servers.

in general, use session smaller apps won't have lot of demand.

if use session, suggest abstracting access it, can change actual storage mechanism @ later time if find session non-performant.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -