I'm creating a graph that does some database queries then builds the graph using GD functions then also puts the info from the database into an array that is stored in $_SESSION['my_data']. This graph is displayed on the web page using img tags.
<img src="my_graph.php?time=$time">
<?
print_r($_SESSION['my_data']);
?>
The problem is when I print_r() the array from the session variable it doesn't print the current graphs data; it prints the data that was in the graph last time the page was loaded. It's acting like a cookie.
I have tried putting session_write_close() immediately after I store the array in the session because I thought $_SESSION might have been locked until my_graph.php finished loading the image. That did not work.
I also tried putting sleep(10) before I print the array and that did not work.
Any ideas why this would happen?