I've tried to figure this out for the past few days and I need other eyes looking at it besides me because I can't locate where I am going wrong with this script. [I can't use sessions, this has to be done with cookies.]
The script creates the cookies when items are added to an items array, then updates the items array and the cookies when the cart is updated. The form that shows the cart contents is created based on the values in the cookies. I know the cookies are being created and have not expired (I can see them in the temporary internet files for IE and in the list of cookies in FireFox) but if I refresh the page, or go to another page the cart goes back to blank. I'm pretty sure the problem has to be in the displaycart function but none of my attempts to fix it have been successful.
The script creates the cookies when items are added to an items array, then updates the items array and the cookies when the cart is updated. The form that shows the cart contents is created based on the values in the cookies. I know the cookies are being created and have not expired (I can see them in the temporary internet files for IE and in the list of cookies in FireFox) but if I refresh the page, or go to another page the cart goes back to blank. I'm pretty sure the problem has to be in the displaycart function but none of my attempts to fix it have been successful.