Shopping Cart: In Session or In Table

Posted on 2005-03-10
Medium Priority
Last Modified: 2013-11-29
I am porting an ecommerce application from native ASP to ASP.NET.  Basically, a complete redesign.  

In the previous version, we kept all shopping cart info in a temp table in the database.  Unfortuantely, IIS has a bug in that the SessionOnEnd would not always fire, so occassionally, the temp table would have to be purged.  I don't want to have to worry about that this time around.

My question is, does it make more sense to store shopping cart info in a session object of ASP.NET or should it stay in a table?

If so, does anyone know if the SessionOn End in ASP.NET and newer versions of IIS are more reliable to fire as expected?
Question by:mmarksbury
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

JackOfAll1 earned 1000 total points
ID: 13516651
I would always keep the information in a database table.  This allows people to return to finish shopping at a later time and better error recovery.  I do not use temp tables because they are lost on server restart.  If you need to purge temp tables a nightly script deleteing by date and/or time easily handles it.

Hope this helps.
LVL 10

Assisted Solution

NeoTeq earned 1000 total points
ID: 13517896
Another thing to consider is that storing them in session will slow things down, especially when the shopping cart contains many different items.
LVL 10

Expert Comment

ID: 13518020

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question