[Help]Attach session to Context
Below is my code:
type newContext struct { context.Context Session *sessions.Sessions }
session := sessions.New(sessions.Config{ Cookie: Cookie, })
app.ContextPool.Attach(func() context.Context { return &newContext{ Session: session, Context: context.NewContext(app), } })
app.UseGlobal(func(ctx context.Context) { ctx.Session // <- for example here not working right now ;( ctx.Next() })
I have looking through example and overridden Context struct to attach my own context, my question is how can i access session in context something like ctx.Session, or what i'm doing wrong? can someone help me?
duplicate of #667
@sunstrikemd we have an example too: https://github.com/kataras/iris/tree/master/_examples/routing/custom-context/new-implementation