Fixing the “Cannot modify header information” PHP error
-
With every page load, the PHP error log shows:
PHP Warning: Cannot modify header information - headers already sent in /wp-content/plugins/simplr-registration-form/lib/wp-session-manager/includes/class-wp-session.php on line 128
To fix, change that line 128 from:
setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN, $secure, $httponly );
to:
if ( ! headers_sent() ) { setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN, $secure, $httponly ); }
- The topic ‘Fixing the “Cannot modify header information” PHP error’ is closed to new replies.