I was working with a client’s programming team on a charts and data binding project lately when we came upon an interesting yet vastly frustrating problem.
The files were built on a machine that had IIS and Apache running, which is fine. The issue was that the date and client ID from the main page was being erased from page to page. We found this frustrating because some other variables (constants) were being held throughout. So the problem wasn’t that the variables weren’t being read or passed on. The problem seemed to be that anything held in the session variables was being lost regardless of the page the user navigated to. This ONLY happened when we moved the program from the Dev server to the production box and integrated it into the current helpdesk system.
We spent nearly 15 hours tracking down the issue, trying everything from increasing the amount of ram the InnoDB was using to moving it to another server. We scoured the files on the dev server for anything that could be erasing the sessions or overwriting them. We looked through the httpd.conf files to see if they were configured properly, poured over the php.ini doc to see if something in there wasn’t set-up the way it should be.
The issue ended up being that the file which had been included to allow the integration with their helpdesk software had a
session_start(); at the beginning of it there-by erasing our variables every time. We removed all session_starts we could find and put one at the top of the helpdesk file that would initially be called by anyone and the program miraculously started working.
This whole thing just goes to show you that the age old saying of “follow your instincts” is usually right.