I am trying to improve my custom session handlers using mysql/memcached.
I want only to write/update in mysql if the session data has changed (or session soon to expire).
How can the handler ie. 'session_write' tell if the data received differs from the data in the mysql row?