ASP.NET Session State Migration

asp.netsession-state

I was hoping someone could validate my assumptions before I recommend that my client upgrade from a 30/mo to a 80/mo hosting package.

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

Problem during busy seasons like we are having now, users are frequently losing their shopping carts and their FormsAuthentication Login information.

Solution I wanted to migrate the site to use a SQL Server Session state. My assumptions are that the customers are losing their shopping carts because the InProc sessions are recycling more frequently then their 20 minute timeout, due to load. Will moving the Session to SQL Server or a Session State Server allow customer to store their Shopping Cart Session without the recycle, If so, can once their will I have any issues if I increase the Session timeout to say 40 or 60 minutes

Best Answer

Using the SQL Session state means that sessions should survive a recycle of IIS, (but not a recycle of SQL Server if you use the default script which creates the session database in the tempdb).

There is a script available from the Microsoft website which creates a permanent session state db. I would recommend using that one instead (See here).

So, to basically answer your question. Yes, the SQL Session state will help. You might want to consider also using the out-of-proc state server to test your theory.

Also, as a co-worker has just reminded me, make sure anything you store in the session is marked as serializable before migrating, otherwise you will run into problems.

Related Topic