Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

I have a problem with fSession directory fCache backend

posted by aurelien 8 years ago


I dont know what I am doing wrong.

I first used fSession in a very basic way, but i had the PHP session locking issue : while opening a long-loading page in which the session is open, a fast-loading page is blocked. Some consider it is a PHP bug, but PHP devs do not.

Anyway, this is a problem to me, and this is a production server with no cache library installed. I then tried fCache directory backend to fSession as an alternative to PHP Sessions. Worked fine : almost same mecanism, without the locks ! Perfect.

Unfortunately, i just realized fSession is creating 10K session files EACH DAY in the cache directory :(

I have more or less 250 daily visitors.

What housekeeping process can i setup? Or maybe this session ID multiplication is not normal?

Any help greatly appreciated


Hi again

I think i missed something : a lot of CLI calls that appear to be creating a lot of session files as well

I separated CLI sessions and actual web session to have a clear view of whats going on

Maybe a simple mistake :)


posted by aurelien 8 years ago

Ok, it appears many sessions are actually "false" sessions from the CLI

However, I noticed that all my web sessions cache files have a TTL at 0, even though I set the lenght at '7 days' using fSession::setLength()

So, correct me if i am wrong :

  • The cache TTL in the session file (first line) will always be 0
  • I have to look for fSession::expires string in the session data and use it to setup some housekeeping process that delets expired files

Is this the right way of handling fCache directory backend Sessions ?


posted by aurelien 8 years ago

No, I believe you found a bug in using fCache with fSession. I have a feeling I am not properly setting a TTL when calling fCache::set(). If you can just open a ticket for this it will ensure I don't forget to fix it. Hopefully I can get to this tonight.

posted by wbond 8 years ago

Thanks a lot


posted by aurelien 8 years ago