IP Address and /TEMP directory

greenspun.com : LUSENET : S-Mart Shopping Cart : One Thread

I got the fix for the SSL problem...thanks to those that posted it. Now the 64,000 dollar question. In /tmp it stores session by IP address, correct? What happens if someone comes from the same ISP? That is one person makes an order one hour and then the next hour another person comes along. Won't they pick up the previous customers contents in the cart??!


-- Bill (webmaster@hardgainer.com), December 28, 1998


Two things to take note about:

1. The script will generate a temporally file to store the information of the product selected by the visitor in the cart. The file name is stored base on the combination of your "storename" and "URL" of where the visitor is coming from (usually ISP address).

2. All the items added in the cart will be stored in the TEMP directory. The cart will only be removed if the items in the cart is purchased or when the cart is deleted.

Therefore, when someone visited the site earlier without deleting the cart or confirm purchase, and the next visitor comes in using the same URL as the previous visitor, the program will use back the file, causing the new visitor to see the previous records plus what he has just added.

To overcome this problem, you can either consistantly go to the TEMP directory and delete all outdated records. Or you can create a CRON procedure to do it regularly.

God bless!

-- Patrick Chan (patrickccf@hotmail.com), January 18, 2000.

Sorry for the mistake. It should be TMP instead of TEMP directory.

God bless!

-- Patrick Chan (patrickccf@hotmail.com), January 19, 2000.

Moderation questions? read the FAQ