Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use new HttpSessionStateWrapper & HttpSessionStateBase? [closed]

I read a comment from an answer to Session variables in ASP.NET MVC. It is recommending to use HttpSessionStateWrapper and HttpSessionStateBase as opposed to using session directly as follows: Session["MyValue"]:

If ASP MVC is being used then it is preferable to not use the actual Session object from HttpContext.Current.Session but to use the new HttpSessionStateWrapper & HttpSessionStateBase from System.Web.Abstractions.dll then use a Factory or DI to get the Session.

Can someone provide an MVC example of using these two aforementioned classes to initialize, retrieve, and set session variables ?

like image 605
NoobDeveloper Avatar asked Jul 08 '13 15:07

NoobDeveloper


Video Answer


1 Answers

This answer might be what you are looking for.

Might also make sense to ask whoever wrote this what he means by that.

like image 133
Dmitry Efimenko Avatar answered Oct 02 '22 21:10

Dmitry Efimenko