Keď to chceš riešiť garbage collectorom, tak:
Kód:
ini_set("session.gc_maxlifetime", 300);
ini_set("session.gc_probability", 1);
ini_set("session.gc_divisor", 1);
To znamená, že s pravdepodobnosťou 1/1 = 100% dôjde k spusteniu garbage collectora, ktorý odstráni relácie staršie ako 300 sekúnd. Netuším, aký to bude mať dopad na výkon, to záleží od mnoho vecí, ale asi to nie je najlepšie riešenie. Každý jeden request na server totiž bude kontrolovať aj všetky ostatné relácie, nie len tú "svoju". Lepšie riešenie je asi pamätať si to v session premennej a kontrolovať ju.
_________________
A. S. Tanenbaum píše:
The terms LF, MF, and HF refer to low, medium, and high frequency, respectively. Clearly, when the names were assigned, nobody expected to go above 10 MHz, so the higher bands were later named the Very, Ultra, Super, Extremely, and Tremendously High Frequency bands. Beyond that there are no names, but Incredibly, Astonishingly, and Prodigiously high frequency (IHF, AHF, and PHF) would sound nice.