Clear Shopping Cart tbl

D

Don Grover

USing ASP, MSSql on W2k3
I am worried of accumulated old cart product selections from expired browser
windows or other unforseen events.


I am holding selected productID's & quantities & userID & sessionID in a
sql table from a shopping cart.
I allow user to clear their cart from a button and also automatically clear
their cart on user logon.
Also on checkout I clear their cart.
I am storing selections with sessionID & UserID so they will be unique,.
But does anyone reccomend any other cart selection maintenance procedure i
could use,.

Regards
Don
 
R

Ray Costanzo [MVP]

You could store the last activity time for each session in the table and
then schedule a job to run that executes something like:

DELETE FROM yourTable WHERE DATEDIFF (mi, LastActivity ,GETDATE()) > 20

Replace 20 with the your session timeout value. (Going higher than your
session timeout would be better. I'd probably use 60 and schedule it to run
every hour or something.)

Ray at work
 
R

Roland Hall

in message : USing ASP, MSSql on W2k3
: I am worried of accumulated old cart product selections from expired
browser
: windows or other unforseen events.
:
: I am holding selected productID's & quantities & userID & sessionID in a
: sql table from a shopping cart.
: I allow user to clear their cart from a button and also automatically
clear
: their cart on user logon.
: Also on checkout I clear their cart.
: I am storing selections with sessionID & UserID so they will be unique,.
: But does anyone reccomend any other cart selection maintenance procedure
i
: could use,.

I keep track of date and time when the shopping experience began and remove
old carts older than 24 hours. One of the sites is quite busy and daily
maintenance takes care of all issues.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
M

[MSFT]

Hello Don,

Did Ray and Roland answered your question? If you need more informaiton
about this issue, please feel free to let me know.

Luke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top