Using Session objects in MVC, is it really bad?

I suggest using a simple session object in MVC3 to store state data such as RecordIds, instead of passing it through all the client-side pages, which would be a problem. It seems a lot easier to just populate the session object once while it is no longer in use.

So is this an acceptable practice or cheat?

Many thanks.

+5
source share
2 answers

There is nothing wrong with using Session objects. As a rule, people avoid them in order to reduce the load on the server; but if you are careful and do not try to put a lot of data there and not too much (how much of them depends on your server too much), then this is an acceptable practice.

ASP.NET mvc, (, )

+7

, - , .

, , ( sql), , : . (http://msdn.microsoft.com/en-us/library/ms178581(v=vs.100).aspx)

, . asp.net( asp.net MVC), , asp.net MVC ajax, ).

, readonly , , , , , , .

, , asp.net . , .

+6

All Articles