Skip navigation.
Home

Session Handler

phpld-session-handler
$4.00

Here is a custom session handler that stores PHP Link Directory's persisten data into the database.

By default the medium used as persistent storage by the default PHP session handler will be a series of disk files, one per session, where the file name is the session_id. A file is created when a new session starts, and is deleted when the session terminates (or has expired). This is perfectly adequate for most circumstances, but it has the following drawbacks:

  • If you are using a shared server then other users of that server may be able to access your session files, thus compromising the security of your site.
  • I/O is usually slower than database queries.
  • Sensitive data is not encrypted.
  • Each server will have its own directory where these session files are maintained, so if you are employing load balancing across multiple servers there is no guarantee that a request for an existing session will be given to the server which is maintaining the state for that session.
  • It would be difficult for a site administrator to perform such queries as "how many sessions are currently active?" or "which users are currently logged in?"
  • There are certainly more exemples...

I have tried several other database session handlers, but either they are lacking some features or are badly designed. Because phpLD is using the nice AdoDB database abstraction library to handle DB operations, I've tried AdoDB's session handler but I have found out the code is just over bloated with unnecessary code, it has a very poor design. While working on a very large project recently, I was in need of a good session handler so I ended up writing my own library for that.

This session handler for phpLD, stores all information encrypted to the database, eliminating most of the security problems regular session handlers have.

Features of this database session handler

  • PHP-5 & MySQL powered
  • Full OOP design
  • Session data can be stored encrypted into DB (using Mcrypt)
  • Very fast, should be much faster than AdoDB's session handler
  • Extandable, you may write more modules for user statistics for example

The requirements for this module is PHP Link Directory version 3+, but I guess it will work with version 2 too. PHP-5 is strictly required and if you choose to encrypt your session data (highly suggested) you also need the Mcrypt extension compiled with phpLD.

Price: $4.00