...
PHP logolás állítása virtual hostban .htaccess-ből
http://perishablepress.com/press/2008/01/14/advanced-php-error-handling-via-htaccess/
Sessionök élettartamasession.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and potentially cleaned up. Garbage collection may occur during session start (depending on session.gc_probability and session.gc_divisor).Jelenleg a phpinfo azt mondja, hogy:
session.gc_divisor | 1000 | 1000 |
session.gc_maxlifetime | 1440 | 1440 |
session.gc_probability | 0 | 0 |
Azaz ini_set('session.gc_maxlifetime', 24*60*60); kéne hogy legyen ha egy napos sessionokat akarunk. Az 86400 az 1440 helyett.
session.gc_probability in conjunction with session.gc_divisor is used to manage probability that the gc (garbage collection) routine is started. Defaults to 1. See session.gc_divisor for details.
session.gc_divisor coupled with session.gc_probability defines the probability that the gc (garbage collection) process is started on every session initialization. The probability is calculated by using gc_probability/gc_divisor, e.g. 1/100 means there is a 1% chance that the GC process starts on each request. session.gc_divisor defaults to 100.
Tehát a pöcs garbage collector akkor fut le ha egy session lejár és akkora esélye van hogy elindul mint a gc_probability/gc_divisor esetünkben 0/1000 ami 0 tehát sosem fut le?! Ezt nem értem.
session.cookie_lifetime specifies the lifetime of the cookie in seconds which is sent to the browser. The value 0 means "until the browser is closed." Defaults to 0. See also session_get_cookie_params() and session_set_cookie_params().
Ami azt jelenti, hogy jelen esetben a browser bezárásakor meghalnak a sütik. Ez nem jó. Hosszú sütikéket akarunk, hogy ne a mi sessionünkben tárolódjon el a belépős adat - szerintem - hanem sütikében instead of it.
Szerintem ez a cookie_lifetime lehetne 864000, ami 10 nap, tehát a cookiek default 10 nap után halnak meg. A session gondolom annyira nem erre való, hogy sokáig eltároljuk, de annak is elfittyenhet 3 nap (tehát gc_maxlifetime 259200).
És hogy tovább véletlen se éljenek a sessionok a gc_divisor-t és a gc_probability-t nagy 1-esre állítanám így az osztalékuk 1, azaz 100%ban meghalnak a cookiek és a sessionok az idejük lejárta után, így nem lenne felesleg.