Shopping cart approach??

Results 1 to 2 of 2

Thread: Shopping cart approach??

  1. #1
    Join Date
    Dec 1969

    Default Shopping cart approach??

    I&#039m working on a shopping cart with ASP and i&#039m not sure of the approach to take. I suppose i could store products someone selects in either cookies or a database. My question is, when trying to maintain state, what&#039s the best approach? How can i assign a unique id to each visitor? I can&#039t use the ID in the session object because if the server is shut down for a moment, etc. certain values might be repeated. What&#039s a typical solution?<BR><BR>thanks.

  2. #2

    Default RE: Shopping cart approach??

    If I understand your problem you are unsure how to deal with storing the items if the server goes down, and a unique id.<BR><BR>The unique id could be table driven.(ie an incremented counter or a collection of them)<BR><BR>By storing the items in the shopping cart in a javascript object you could save your self the trouble of using session variables, having the server go down and have a lot more flexibility. Of course, these objects are only resident on the client but can easily be transfered to the server via http.<BR><BR>This seems to be a somewhat popular method and Javascript is pretty easy to deal with. <BR><BR>I haven&#039t seen any links with javascript object examples but there is actually a shopping cart example in Professional Javascript from Wrox.<BR><BR>I hope that is what you are looking for.<BR>capn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts