Yandy.com has a feature that allows its users to scroll through all the products in a category by clicking the "previous" or "next" button above the product picture when you are viewing a product. If you go to the Yandy.com homepage and click on any of the "featured products", you will be able to scroll through each one by clicking the "previous" or "next" buttons above the main product picture. This feature seems to work very well on the index page. The way it works is when the query is made to select all the products in a category, an array is made of all the product's "product ID's" that were just queried. After the array is made, it is added to a session (I also tried cookies and had the same issue). Then, when a user selects a product to view, the product ID for the product they just selected is searched out in the array (session) and when found, tells the program which product comes prior and next to the current product. I have done extensive testing to make absolutely sure that the array is being created correctly and does exist in the session after the page is fully loaded (and it does). The problem is that when I click on a new category or product, sometimes the session changes or disappears. Here is what I have determined so far:
1. The problem does not occur in Firefox. It only appears to happen in Internet Explorer.
2. We are using a mod_rewrite in the .htaccess file that allows us to use static URL names for each of our products and categories. We seem to lose the session when switching between a URL that uses a different directory. Example: The session will exist while in
http://www.yandy.com/Shopping/products/category_19.asp, but then is lost when switching to
http://www.yandy.com/shoes.php. I am aware that sessions and cookies usually cannot be transferred between different directories, but no matter which product (or category) they click on, the code is always using the same php script at root level.
3. There is a session_start on the top of every page (I also tried it with If(!isset($_SESSION) and also If(session_id() == "") ) and have also tried a session_write_close at the bottom of every page (but removed it now).
4. I have googled and tried every idea I have read without any luck.