[thelist] ASP: Shopping Cart Theory

Norman Beresford n.beresford at anansi.co.uk
Mon Jul 8 14:40:01 CDT 2002


Hi Ken

AFAIK IIS doesn't assign a new session if the user opens a new window.  The
session cookie is available to all instances of the new browser, the user
would have to shut down all their browser windows and then open a new
instance of it and then connect to the site again to create a new session.

The solution I use for our shopping systems is easy.  When a customer
selects their first item a temporary basket is created in a DB.  The ID
number for that basket is then saved into a cookie on the customers machine.
That way you don't have to worry about the limits that cookies impose upon
the amount of information you can store in them, and you can persist baskets
beyond a single session by setting an appropriate expirary date for each
one.  I'll also store the item count for a basket in the cookie so that it
can be displayed on every page without a visit to the DB being made.

My understanding is that best practice for ASP is to avoid using session
variables where ever possible.

Norman




More information about the thelist mailing list