I thought it should be server-side specific and this should not introduce differing behaviours dependant on the browser.
The following code evaluates to null while in firefox it has data which is processed into a table later.
$History = (isset($_SESSION['History']) ? $_SESSION['History'] : null);
Just as a quick test I have done
printf( "<p>Variable history%s", $History);
Which returns the following in firefox:
Notice: Array to string conversion in /website/History.php on line 92
Variable historyArray
While in chrome it just returns null aparently:
Variable history
Just to clarify, I don't have a problem the variable being an array (that is intended,,the above was just a debug type test) I have a problem with the variable being empty. It does seam repreduceable in firefox in private mode only but I don't see why is the difference in chrome in normal mode while cookies are enabled.
Initially I was using (!isset($_SESSION)) session_start(); but using either that or session_start(); does not change this outcome.
You are currently trying to sort out 2 problems: what's happenning with the session and what's in the $history. You've told us nothing about how the latter is populated.
The first step you should take for debugging any PHP issue is to ensure that error reporting or logging is enabled and see if PHP is emitting any errors. That you have reported a warning in your post implies that you have this covered.
For sessions, because they are persistent you should create a small script to reset the current session - then you can get the session back to a known state by accesing it in your browser, e.g.
<?php
error_reportling(E_ALL);
session_start();
print "<pre>" . var_export($_SESSION, true) . "</pre>";
if (count($_GET)) {
$_SESSION=array();
print "session reset";
}
You should also be using a tool which allows you to see the request and response headers so you can easily check things like the caching instructions and names/values of cookies.
Finally, the issue here appears to be with the population of $_SESSION['History'], but you should check this with a simple session based script:
<?php
session_start();
if (!$_SESSION['test']) {
$_SESSION['test']=1;
}
print "iteration: " . $_SESSION['test']++;
Once you're happy that the session handling has nothing to do with the problem, and that you are not seeing the fallout from previous steps in debugging. have a look at how $_SESSION['History'] is populated (hint, use var_export($x, true) or serialize($x) rather than just print/printf to see the value).