Skip to content
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

Starting a session in RaygunClient is bad practice #17

Closed
mrardon opened this issue Oct 20, 2013 · 6 comments · Fixed by #18
Closed

Starting a session in RaygunClient is bad practice #17

mrardon opened this issue Oct 20, 2013 · 6 comments · Fixed by #18

Comments

@mrardon
Copy link
Contributor

mrardon commented Oct 20, 2013

2743b49#diff-c56c61631471a217e3f4007c5e16b1c5R24

This causes issues with a framework that handles sessions itself, such as Symfony. I am using PDO Sessions and this change referenced above breaks compatibility with the system.

A fix may be to say if a session is not already started to disable user tracking, instead of force starting a session.

@CmdrKeen
Copy link
Contributor

Valid feedback, thanks Matt.

Effectively, if there's no session, we'd still like to obtain some sort of unique identifier for the session, but perhaps falling back to setting a GUID in the client for the duration of the request would be enough (or we could allow you to call to set the session id later? Would that help?). Ideally we want to get a system that "just works" but certainly we need to respect the various frameworks.

Thanks again for your feedback, let me know if you have any further thoughts with regards to what I've mentioned 👍

@mrardon
Copy link
Contributor Author

mrardon commented Oct 20, 2013

Would a simple cookie not work? This would not interfere with sessions (chartbeat uses something like _chartbeat2 to track a user and google analytics uses a few cookies for the goal). Not sure if this would serve the purpose or not as I haven't really looked into all of what the user tracking is doing (I already send user information in the custom data portion).

@CmdrKeen
Copy link
Contributor

Cookies would work for client side work, yes, but we're looking to track the backend session as well so when we send data we can connect information.

To give you a clearer picture of where this is going: Our goal is to eventually let you see an exception, but then seen the flow the user took to get to that stage. Stack traces and environment variables are helpful, but understanding their overall way of getting to the fault can assist too (I know personally I've had those errors where you're left scratching your head thinking "there should be no way they could get into this state?!").

Cookies do seem like the smarter plan, I'll have @fundead look into that today (he maintains the PHP provider).

@fundead
Copy link
Contributor

fundead commented Oct 21, 2013

Thanks for the heads up on how Chartbeat & GA handles this. The above branch has a candidate fix for this issue to set a cookie instead and it appears to be working fine locally. If you could verify that it works with your environment I'll get it merged into Master.

@mrardon
Copy link
Contributor Author

mrardon commented Oct 22, 2013

I wasn't able to check this out today. I will try to test it tomorrow.

@mrardon
Copy link
Contributor Author

mrardon commented Oct 22, 2013

Was just able to check it out - looks like the error I was receiving before is now gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants