CodeIgniter Forums
session garbage collector - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: session garbage collector (/showthread.php?tid=44009)

session garbage collector - El Forum - 07-30-2011

somebody can tell my why the garbage collector for the data base sessions don't work? and i don't know if CI take cares of making sessions for the same ip, if i delete the cookie from the browser and enter to the website the session class start another session but the old one still on the database.

i have to create my own routine to delete all this garbage?

( ┬┐or is best to forgot about CI sessions ? )

session garbage collector - El Forum - 07-30-2011

Don't worry, it just takes a while. I was puzzled the first time, too.

The garbage collection is done on a random base with a probability of 5 out of 100 runs, and then only expired entries are deleted.

session garbage collector - El Forum - 07-30-2011

but there are other's problems, if i delete the cookies with the browers, and enter to the site, it's start a new session, and another and another and another...

anyway i changed session class for ndb session class

thanks for the answer.

EDIT: yup, ndb works perfect C:

session garbage collector - El Forum - 07-31-2011

NDB sessions use the standard PHP session as backend.

Apart from possible security issues (all web apps on the same host can access those session files), the garbage collection process for session files works exactly the same as CI's GC process for DB sessions. So what have you solved now?

You could have read the manual as well, which tells you you can control the GC process by increasing the GC probability. If you set this to 100%, it always runs, and removes expired session records on every load of the session library. If that is desired is up to you.