-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting cookies when headers sent #23
Comments
Thanks for spotting this, I've managed to repro that and the fix you suggested does indeed work. You'll find the updated master branch with the change. |
As an aside - if you're not setting the user until after you've started streaming the content then you will lose the benefits of session tracking (which, for now, are not obvious since we're just building out support for this in the Raygun app). While we have the guard I'd suggest setting the user earlier if you want to take advantage of what this feature will evolve to 👍 |
Recently Raygun started tracking users by setting unique id cookies. The problem is that sometimes an error occurs after output has already started (e.g., if the error is triggered in a template). This results in another error being triggered, since you can't set cookies after output has been sent to the browser.
A pretty easy fix would be to add a conditional:
if(!headers_sent())
in RaygunClient.php before calling setcookie().
The text was updated successfully, but these errors were encountered: