Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Jonathan N. Little
December 6, 2005, 4:59 am
rate this thread
cookies I converted my site to PHP. Originally I use session cookie to
keep track of items our patrons selected on our gallery for checkout.
Since the cookie was just in the clients browser memory, garbage
collection was simple. Now with PHP sessions, patrons now do not have to
have cookies enabled to shop on our site, but since this is not a 'log
on' and 'log off' situation there is not an explicit 'log off' event to
destroy the session. The stale sessions files pile up. Is my only option
create a maintenance script to run periodically to delete session file >
LITTLE WORKS STUDIO
Re: stale session files
Every time a session starts it is (by default) 1 percent chance that it
will be run.
session.gc_probability = 1
session.gc_divisor = 100
Change this if you like. But it will also add some extra work to the
engine if you have high rate of visitors ( = collector runs too often).
If you want a neat session handling it's quite useful to take a look at
and store session data in a database. It will give you much more
control over the data.