Migrating ASP.NET Session State

I was hoping someone could confirm my assumptions before I recommend upgrading my client from 30 / mo to 80 / mo hosting.

Site: A site is a custom ASP.NET ecommerce site. shopping carts are stored in the inproc session.

The problem during busy seasons like now is that users often lose their shopping carts and their FormsAuthentication registration information.

Solution I wanted to migrate a site to use SQL Server session state. My assumptions are that customers are losing their shopping carts because InProc sessions are used more often than their 20 minute timeout due to the load. Moves the session to SQL Server or Session State Server so that the customer can store their session in the shopping cart without reuse. If so, maybe after their will, I will have some problems if I increase the session timeout to 40 or 60 minutes.

+1


source to share


3 answers


Using SQL session state means that sessions should survive IIS recycling (but not SQL Server recycling if you are using the default script that creates the session database in tempdb).

There is a script on the Microsoft website that creates persistent db session state. I would recommend using this instead (see here ).



So, to basically answer your question. Yes, SQL Session state will help. You might also want to consider using an external state server to test your theory.

Also, as soon as a coworker reminded me, make sure that whatever you store in the session is marked as serializable before migration, otherwise you will run into problems.

+2


source


Could you just add RAM to the box? This can help and is likely to be cheaper and easier than migrating the session to SQL Server. Sure, it would be just a stop second, but if he were to save them $ 50 a month for a few years it would probably be worth it.



You can also check the code to see if there is any other data remaining in the session much longer than necessary.

+1


source


The assumptions sound reasonable to me. might also want to look at the AppPool settings and try to figure out why it's being reworked. Perhaps all you have to do is change those (if you can).

0


source







All Articles