Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shopping Basket - where to store it between sessions?

Status
Not open for further replies.

ben1234zz

MIS
May 12, 2008
71
GB
Hi

We currently have a site with a shopping basket which is stored in a datatable for each session.

However, customers (and I) don't like that the basket clears after your session ends.

So what options do I have?

I could give the user a unique ID, if they have cookies enabled I can store their ID in a cookie and then add all baskets to our SQL Server database, which has its benefits as it simpifies my coding especially when it comes to pricing updates and the checkout. I could then see how much impact there is and decide how long to keep the basket alive in the DB.

Any suggestions would be much appreciated?

Thanks B
 
If the user has a shopping cart, i can assume they have a valid account in your system?

Going on this assumption, why not just store their basket in the db and save it to their user account. This will allow you to access this at any point, even if their session is dropped and you need to have them log in again.

If a user is just a guest, you could track the shopping cart in the db by attaching their ip address.

I would stay away from cookies and keep with using the ASP.NET session. This is safer, cleaner, and browsers like this more.
 
Hi

Thanks for your post.

They may not have an account when they use the basket initially, only after their first purchase.

Unfortunately the IP address side of things may cause a few issues: for example if they are not using static IP's, or if multiple persons from the same office are purchasing (i.e. using the same IPs) someone may start to share another's the basket.

Is there any other way of identifying the machine indefinitely?

Many thanks
B
 
Is there any other way of identifying the machine indefinitely?
Not really, there are only things you can do to make your site easier to use. There is a point where you can go to far and try to account for too many situations.

I would suggest not allowing the guests baskets to stay around, this is extra data that you are storing for a user that has never purchased from you. This could potentially use up a lot of database space. I would give them the option to save what is in their basket by signing up. This allows you to track users better and get a good feel for site metrics.
 
I echo david's advice. if you want to track information about the user you need to know how the user is. this requires an account of some kind.

if this is a typical shopping cart for music, books, widegts, etc. I don't know if there is much value in holding the cart between sessions. if the session expires it means no activity form the account, or the user logged out. either way they are abandoning their cart.

Now some B2B applications require that orders be piecemeal together over period of time. this would require persistence of the shopping cart.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top