I've been looking into making my own session handler for my PHP application, simply because I want to store the session data in a MySQL Memory table instead of on the local filesystem.
There are 4 main reasons for me to do this.
I can't seem to find any easy way for doing this.
I could use memcached, but it would result in doubling the session data in the memory on my server.
Does anybody know of an easy way, to force PHP at run-time, to use a MySQLi resource as session storage?
Actually Mysql offers a memcache interface that first uses memory and can later on persitent into a real database table.
It can be simply configured via php.ini after you've create the tabels in your database server (see here):
; when using the "memcache" extension:
session.save_handler=memcache
; when using the "memcached" extension:
; session.save_handler=memcached
session.save_path="tcp://localhost:11211"
You find it outlined here with PHP examples: