I just finished watching Stefan Schackow’s PDC 2009 session and he mentioned that he is surprised that people are still using Session State in ASP.NET. Session State is even used internally in ASP.NET MVC.
Having worked with a legacy application where everything is put into a “in-proc” session (even datatables!), I’ve seen session abuse first-hand.
Is there a way to build an ASP.NET application without session state? How would you store information for each step of a typical e-commerce workflow?
I haven’t used a session in years. If you need to track a user’s progress between pages (say, through a cart checkout process), store whatever state information you require in a database and relate it back to the user with a cookie.
It’s worth noting that .NET supports different “session” mechanisms, one of which stores the information in a database (much preferred in my opinion) instead of in-proc.