maybe I’m missing the bigger picture here, but I feel the DbSession class is not really well thought through? Right now there are at least three database queries on every page while in theory a lot of the time one would be enough.
There are two queries for the same session record on opening (DbSession::readSession) and closing (DbSession:: writeSession) the session. With minimum refactoring the second call should only be needed in case DbSession::readSession didn’t return any data? Or maybe not even then (record not found => insert new)?
And then DbSession:: writeSession saves the session data on EVERY request, even though there might be no change at all? Am I missing something? Even "expire" could be updated only once every 30 seconds or so?
Before I write an extended class for DbSession I wanted to know if there is something I’m not thinking of.
Thank you for your time.