{"action":"closed","issue":{"url":"https://api.github.com/repos/idno/Known/issues/1365","repository_url":"https://api.github.com/repos/idno/Known","labels_url":"https://api.github.com/repos/idno/Known/issues/1365/labels{/name}","comments_url":"https://api.github.com/repos/idno/Known/issues/1365/comments","events_url":"https://api.github.com/repos/idno/Known/issues/1365/events","html_url":"https://github.com/idno/Known/issues/1365","id":140804836,"number":1365,"title":"API: Cannot modify header information warning from Session::logUserOff","user":{"login":"kylewm","id":950127,"avatar_url":"https://avatars.githubusercontent.com/u/950127?v=3","gravatar_id":"","url":"https://api.github.com/users/kylewm","html_url":"https://github.com/kylewm","followers_url":"https://api.github.com/users/kylewm/followers","following_url":"https://api.github.com/users/kylewm/following{/other_user}","gists_url":"https://api.github.com/users/kylewm/gists{/gist_id}","starred_url":"https://api.github.com/users/kylewm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylewm/subscriptions","organizations_url":"https://api.github.com/users/kylewm/orgs","repos_url":"https://api.github.com/users/kylewm/repos","events_url":"https://api.github.com/users/kylewm/events{/privacy}","received_events_url":"https://api.github.com/users/kylewm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-14T21:39:23Z","updated_at":"2016-03-16T15:44:09Z","closed_at":"2016-03-16T15:44:09Z","body":"logUserOff is called at the end of request, which tries to update headers (in setcookie)\r\nafter body has already been written, resulting in \"Warning: Cannot modify header information - headers already sent...\"\r\n\r\n\r\n## While trying to do this:\r\n\r\n(from Woodwind) fetch @sensiblemn's `/micropub/endpoint?q=syndicate-to` to get micropub syndication targets\r\n\r\n```\r\ncurl -i -H \"Authorization: Bearer ...\" -H \"Accept: application/json\" https://sensible.mn/micropub/endpoint?q=syndicate-to\r\n```\r\n\r\n\r\n## I encountered this error:\r\n\r\nI got the response:\r\n\r\n```\r\n{\r\n    \"syndicate-to\": [\r\n        \"facebook::604496009638056\",\r\n        \"twitter::sensiblemn\"\r\n    ],\r\n    \"syndicate-to-expanded\": [\r\n        {\r\n            \"id\": \"facebook::604496009638056\",\r\n            \"name\": \"Sensible Minnesota\",\r\n            \"service\": \"facebook\"\r\n        },\r\n        {\r\n            \"id\": \"twitter::sensiblemn\",\r\n            \"name\": \"sensiblemn\",\r\n            \"service\": \"twitter\"\r\n        }\r\n    ]\r\n}<br />\r\n<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /var/www/sensible.mn/public_html/IdnoPlugins/IndiePub/Pages/MicroPub/Endpoint.php:55) in <b>/var/www/sensible.mn/public_html/Idno/Core/Session.php</b> on line <b>334</b><br />\r\n```\r\n\r\nwhich has the proper JSON object followed by a warning message that doesn't parse.\r\n\r\n## Some other notes:\r\n\r\nThis may be IndiePub specific, but I'd think the way logUserOff is called in a shutdown function, it would affect every API call."}}