Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Buiding ASP.NET application without Session State?

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?

like image 206
Herman Avatar asked Nov 22 '09 02:11

Herman


1 Answers

You've got the following options: cookies, database, querystring, page variables, and server cache to try to handle the stateless nature of the web. Each has its own tradeoff, but pragmatically speaking I currently use session that gets stored in the db. This scales well for server farms, helps to keep your pagesize small, and is easy to implement.

like image 139
Trent Avatar answered Sep 25 '22 02:09

Trent