Unanswered: Losing Session in Internet Explorer Only
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.
Since we last talked, I have determined that if I remove the session from the index.php file, it works on all of the other pages. The weird thing is that if I am viewing the category pages on internet explorer and they are working, then I add the session to the index.php page, the category pages won't work anymore, even if I don't go to the index.php (home) page. The index.php page is also not included in the the category pages in any way, so I am having trouble figuring out how it can affect them. Any suggestions would be great. Sessions are passing perfectly between all other pages.
Any chance that some of the url's have the www. and some don't?
By default, the session.cookie_domain is none, meaning the host name where the session was started. So, a session started on a page with www.domain.com won't carry over to a page with just domain.com and visa versa.
For session problems, either check your web server log for errors and/or turn on full php error reporting.
It's just occured to me that you appear to be using two different scripting languages... If you first post the URL ends with .asp whereas your second url appears to end in .php . Are you using both languages?