Failed to start the session because headers have already been sent

Created on 29 March 2018, about 7 years ago
Updated 19 February 2025, about 1 month ago

A Runtime exception (Failed to start the session because headers have already been sent) is thrown for authenticated users when a flag is clicked or unclicked. The populateFlaggerDefaults function in FlagService creates a session for an anonymous user but when the user is authenticated, it still attempts to create the session hence the exception.

πŸ› Bug report
Status

Needs work

Version

4.0

Component

Flag core

Created by

πŸ‡ΊπŸ‡ΈUnited States mwebaze

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024