I'm trying to set up a timeout test on a selection of files. The files run the test via an include, which contains the following:
$inactive = 20;
/* check to see if $_SESSION['timeout'] is set */
$session_life = time() - $_SESSION['timeout'];
if($session_life > $inactive)
$_SESSION['timeout'] = time();
Each of the pages using it begin as follows:
include ("data_fr443zzw/timeout.dat.php"); /* Timout test */
6 of the pages work as I'd expect, redirecting on timeout, but one does not. The only difference I can see is that the 6 pages are presentational and have HTML and forms as well as PHP in them. The failing page is pure PHP, dealing with POST and SESSION variables to redirect the browser to the appropriate page.
The failing page effectively continues past the included code and executes that, redirecting based on POST variables, rather than the timeout SESSION variable it encounters first. If I add "die()" after the include on this page, for example, the timeout works, redirecting before executing the die().
No problem, once done, could you mark as solved and give rep as you feel appropriate?
Once I feel it's solved, of course. I'm not happy that it's contrary to programming logic, and therefore suggests issue with PHP, but I'll test it out properly and keep thinking where I may have misunderstood something.