SSLgreenspun.com : LUSENET : S-Mart Shopping Cart : One Thread
I see that alot of people have a question in regards to SSL and losing there cart contents. I also saw the answer from Barry in that when you have 2 seperate servers we need to have a tmp directory that both servers can share or have the non-secure tmp(cart) copied to the secure one. Please expalin on how we can write to both tmp files. I know that it will work when you copy the file and upload it to the secure server. I need to know and I am sure that everyone else needs to know how to do this as well. Thanks in advance for the help Steve
-- Steve Ixes (Stix@internetMCI.com), May 02, 1998
Here is how I fixed my problem (by he way thanks to the "Noname" that helped me for that...).
My secure and standard server are in two physical areas, and I had the problem you mentioned: cart deleted when going on secure server. Actually, not really deleted but rather differently interpreted. Barry's script uses the CGI environment variable 'REMOTE_HOST' to create the $REFFILE, containing client's information. The problem is that this variable is differently interpreted depending on the protocol the server is using: it can be the client's host server name but also his IP adress.
So in my case two different REFFILE were created in the /tmp directories, one with server name and one with the IP adress on the secure server, and as Smart the program might be it couldn't read client's information from one server to another...
The solution to this problem is to replace the variables REMOTE_HOST with REMOTE_ADDR REMOTE_ADDR gets only the client's IP adress, and there can't be be any confusion between the two servers. Just make a "find REMOTE_HOST" and "replace with REMOTE_ADDR" and everything should be allright.
Hope I could help,
-- S, Viaud-Murat (email@example.com), May 04, 1998.
That worked! My server and secure server is on different machines and the change from REMOTE_HOST to REMOTE_ADDR fixed it!
-- Scott Moore (firstname.lastname@example.org), June 08, 1998.