I have two files file1.php and file2.php. File2 draws an image. File1 builds a page using the image drawn by file1. File1 can be called from links on the resulting page. ie it calls itself. I have session vars(arrays) defined and they are functioning, but with a twist..
file1.php
<?php
session_start();
require_once("vars.php");
some code stuff..
print("<img src=file2.php.......");
some more stuff;
print("<a href="file1.php.........")
print("Val = %s",$_SESSION['test'][0]); // check val in array
?>
file2.php
<?php
session_start();
code to draw image fills in test[0] etc;
example: $SESSION['test'][0] = "All done #7";
print("Val = %s",$SESSION['test'][0]); // check value
?>
vars.php
<?php
$test = array(0=>1, 10=>10);
include_once ("file2.php");
some other vars not session related..
?>
The page generated is correct only after I do a reload (refresh). The browser cache control is check page at every view and I have tried setting session_cache_limiter('nocache'). If I dump $SESSION in file2, vars are correct. However if I dump $SESSION in file1 after img src call, the vars reflect the previous pass of the page. Any insight welcome..
Thanks..
🙂