Register Session Error
-
Hi, I tumbled over an error message caused by the Podigee Plugin.
PHP Warning: session_start(): Session cannot be started after headers have already been sent in /wp-content/plugins/podigee/podigee-quick-publish.php on line 320
So checking
headers_sent()
turns out that the header was already created and has the following output:# if(headers_sent()) error_log(json_encode(headers_list())); ["Expires: Wed, 11 Jan 1984 05:00:00 GMT","Cache-Control: no-cache, must-revalidate, max-age=0","Content-type: text\/html; charset=UTF-8"]
If this comes from the wp-core there are only two sources,
wp-cron.php:24
andajax-action.php:184
. I’m not sure why wp writs already the header during the init process.I see tree possible solution,
- check if the header is already written
headers_sent()
, - on init register_session earlier
add_action('init', 'register_session', 9); // default 10
- or you just start the session if the requested URI doesn’t contain wp-cron.php
Does anybody else has this error?
Regards Valentin
- check if the header is already written
- The topic ‘Register Session Error’ is closed to new replies.