-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Aloha, plugin developer here, fielding a report from a Pantheon user who noted that sessions were no longer working after upgrading to PHP Runtime Generation 2.
We've done some debugging and confirmed that native sessions (e.g., /var/lib/php/sessions/) are still trying to be written to the read-only filesystem, even after this plugin is successfully running in mu-plugins.
After activating this plugin, we've confirmed that the wp_pantheon_sessions table has been created, and that session_set_save_handler() is returning true.
https://github.com/pantheon-systems/wp-native-php-sessions/blob/main/pantheon-sessions.php#L216
However, session_start() and $_SESSION variable access results in the core PHP session handler being invoked, which leads to logged warnings, e.g.:
[09-Dec-2025 23:43:36 UTC] PHP Warning: SessionHandler::read(): open(/var/lib/php/sessions/sess_bj8q2eic3pstpq4er0k1bm2jhl, O_RDWR) failed: Read-only file system (30) in /code/wp-content/plugins/authorizer/vendor/apereo/phpcas/source/CAS/Client.php on line 973
[09-Dec-2025 23:43:36 UTC] PHP Warning: session_start(): Failed to read session data: user (path: /var/lib/php/sessions) in /code/wp-content/plugins/authorizer/vendor/apereo/phpcas/source/CAS/Client.php on line 973I confirmed that the Pantheon_Sessions\Session_Handler class methods do not get invoked (via error_log() calls in the relevant functions in wp-native-php-sessions/inc/class-session-handler.php).
In the particular case of the plugin I maintain, sessions cannot be avoided because an upstream composer package uses them (for integration with CAS authentication servers): https://github.com/uhm-coe/authorizer/blob/master/vendor/apereo/phpcas/source/CAS/Client.php#L973
Not sure the specifics of what changed with PHP Runtime Generation 2, but we're happy to help debug if you struggle to reproduce the issue. Cheers