How to properly implement a custom session persister in PHP + MySQL?
I'm trying to implement a custom session persister in PHP + MySQL. Most of the stuff is trivial - create your DB table, make your read/write functions, call session_set_save_hander() , etc. There are even several tutorials out there that offer sample implementations for you. But somehow all these tutorials have conveniently overlooked one tiny detail about session persisters - locking . And now that's where the real fun starts! I looked at the implementation of session_mysql PECL extension of PHP. That uses MySQL's functions get_lock() and release_lock() . Seems nice, but I don't like the way