Package-relative port of ssx's original patch (https://gist.github.com/ssx/46930699a0b5506e4de1db0d8b96c619, written against vendor/magento/framework) for the mage-os/framework package. All credit for the change goes to ssx. This copy only rewrites the paths and regenerates the hunks so they apply cleanly.
Session/SaveHandler.php: implementsSessionUpdateTimestampHandlerInterface. AddsvalidateId()(rejects ids that have no stored session data, which is whatsession.use_strict_mode=1needs) andupdateTimestamp()(delegates towrite(), as PHP does when the method is absent).validateId()hands the data it read to the nextread()so the session is not read twice.Session/SessionManager.php: when a session is already started, its id wins over the request cookie, becausesession_start()may have replaced it under strict mode.