only update session in mysql database when required #14540
This is a small update to help address issues with the mysql session store while we re-architect the session system.
It keeps track of whether the session data has been modified, and only issues an update to the database if the data has been modified or the expiry value is more than 60s old.
My testing indicates that this will reduce the number of UPDATE queries sent to the database quite substantially.
I feel confident, @cinaglia came up with an almost identical patch independently which is encouraging.
In our discussion we did notice that there isn't any checking of expiry in