I have recently started getting new php error messages from the WP Native Php Sessions Plugin. I migrated our company website to Pantheon from Rackspace last week, and didn’t have these messages when we migrated over. I am running WP 5.1.1 and PHP ver 7.2.
[25-Mar-2019 18:33:00 UTC] PHP Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in /srv/bindings/eb1edf5e1815436e86bb181ec87e13bf/code/wp-content/mu-plugins/wp-native-php-sessions/pantheon-sessions.php on line 131 [25-Mar-2019 18:33:00 UTC] PHP Warning: session_set_save_handler(): Cannot change save handler when headers already sent in /srv/bindings/eb1edf5e1815436e86bb181ec87e13bf/code/wp-content/mu-plugins/wp-native-php-sessions/pantheon-sessions.php on line 141
The above error message are pointing to the following code:
// Get cookie lifetime from filters so you can put your custom lifetime ini_set( 'session.cookie_lifetime', (int) apply_filters( 'pantheon_session_expiration', 0 ) );
session_set_save_handler( '_pantheon_session_open', '_pantheon_session_close', '_pantheon_session_read', '_pantheon_session_write', '_pantheon_session_destroy', '_pantheon_session_garbage_collection' );
1.) Do I need to put a custom lifetime cookie value in place of zero?
Here is a related issue where a few other people are describing the exact same problem: