Page 1 of 1

sessions and duplicate entries

Posted: Thu Oct 26, 2006 11:09 am
by nutstretch
I have a site which creates a session and uses that session id for the shopping cart id. I also use that is as the order id when they user goes to the checkout. Once an order has been confirmed by the user and they are going to the payment pages the shopping cart is copied across to the order table to store the details in. the problem that i am finding is that if some one goes this far but then decides to add more to they get a duplicate entry error message as there is already an order in the table for that id. Does anyone have a way i can get round this. I have put a message box on saying go any further and you can't add any more, but my testers seem to ignore this. Also if they decide to have a nother order and they haven't leaft the browser it still has the same session id.


Thank you in anticipation

Nuts

Posted: Thu Oct 26, 2006 12:21 pm
by RobertGonzalez
There are like three or four layers of logic that you will need to apply to this. First, you might now want to use a text message as a means of forcing your app to do something. Instead, if they get to a certain point, use your code to not allow them to go back and add. And after they have completed, use your code to destroy their session and start a new one so that if they do want to shop more, they can without keeping their original session id. These are just a few suggestions. I am sure you will get more in this thread.