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

scs: no session data in context in fiber framework #106

Closed
Koredeoluwafemi opened this issue Feb 22, 2021 · 3 comments
Closed

scs: no session data in context in fiber framework #106

Koredeoluwafemi opened this issue Feb 22, 2021 · 3 comments

Comments

@Koredeoluwafemi
Copy link

I am having this issue on the go fiber framework, I want to know how and where do I pass in the http.handler into the LoadAndSave middleware

@NWBY
Copy link

NWBY commented Apr 12, 2021

Stuck on this one as well. Anyone got any ideas?

cc @alexedwards

@alexedwards
Copy link
Owner

If you're getting a no session data in context error it means that the request context is not being propagated throughout the middleware -> handler chain correctly.

The scs.LoadAndSave method is standard net/http compatible middleware, so if Fiber isn't propagating the request context from it, then it sounds like either bug in the Fiber codebase or the result of a deliberate design decision by them. I think you'll need to pose this question to the Fiber team to get to the root of the problem.

@alexedwards
Copy link
Owner

I've updated the compatibility note in the README to warn people that using Fiber with this package may not work correctly: https://github.com/alexedwards/scs#compatibility

As mentioned above, I think the incompatibility exists due to a design decision by the Fiber developers to not propagate request context, rather than there being a bug with SCS. So I'm going to close this issue but if you disagree then please reopen.

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

No branches or pull requests

3 participants