I Posted a topic recently (A few days ago) about the fact that my SESSION just ended even though I was reloading my "tracking" page.
Now I have tracked the cause of my problem down.
I had these settings for session garbage collection:
Code: Select all
session.gc_probability = 1
session.gc_maxlifetime =I thought:
AHA! If I modify the session data at every reload, it might not destroy my session just like that. Here is that new tracking code:
Code: Select all
<?php
require_once $_SERVERї'DOCUMENT_ROOT']."/Includes/Globals.php";
if (!isset($_SESSIONї'GARBAGE_PREVENTER'])||$_SESSIONї'GARBAGE_PREVENTER']>10)$_SESSIONї'GARBAGE_PREVENTER']=0;
$_SESSIONї'GARBAGE_PREVENTER']++;
// the session var above is modified at every reload.
$Action = "'CheckThings.php?time=".time()."'";
?>
<HTML>
<HEAD>
</HEAD>
<BODY OnLoad ="<? echo $UpdateMenuStr ?>" BGCOLOR="#bbbbbb">
<SCRIPT LANGUAGE=JAVASCRIPT>
function Reload(){
document.location=<?=$Action?>;
}
window.setTimeout("Reload()",<? echo intval($_SESSIONї'POLL_INTERVAL'])?>);
</SCRIPT>
</BODY></HTML>
?>Code: Select all
session.gc_probability = 100
session.gc_maxlifetime = 10I understand that PHP needs to remove some old data from the disk space. But why is it removing data that is less than a second old?:evil:
Very strange.
Is there a better solution to this issue that just setting the time limit to 36 000 seconds?
I dont want the site visitors to raise their eyebrows because they have suddenly been logged out without reason.
Does my partition grow full if I set session.gc_probability = 0?