Database Development MongoDB PHP

Authored by Corey Ballou

1 Comment

Important MongoSession Updates

I have posted a couple of important updates to MongoSession (a PHP MongoDB Session Handler) that I’d like to share with you.

  1. I have removed the secondary indexed id field which should speed up operations as well as reduce the storage requirements. This is most beneficial for larger sites supporting a high rate of concurrent users.
  2. I recently added two boolean constants, FSYNC and SAFE. These two constants are documented on the MongoCollection::update() page and can be turned on to ensure your session data is actually written to the server. Please note that turning these variables on will cause a performance hit to the overall session handling.
  3. Both the garbage collection and session write methods have been updated to perform atomic operations. This was done as a measure to reduce the risk of race conditions as mentioned on the project page.
  4. A bug was fixed in the read method where an extra line of code existed for no reason.
  5. A bug in the garbage collector was fixed. Update previously only updated a single result as opposed to the whole set of matches.

Click here to be taken to the project page.

Questions, comments, forks, and bugfixes are welcome.

Author: Corey Ballou

Corey Ballou is the CEO of Whether you're a student, young professional, entrepreneur, startup, or small business, you can be up and online fast with your own custom domain, email, and webpage on POP. Corey is a professional PHP developer by trade, specializing in custom web applications development for startups, small businesses, and agencies. Follow Corey on Twitter @cballou.

  • PHP Application Development

    Very informative blog. I like your blog because of unique content. thanks for sharing such a useful information.