MCPcopy Index your code
hub / github.com/kataras/iris / Handler

Method Handler

sessions/sessions.go:182–191  ·  view source on GitHub ↗

Handler returns a sessions middleware to register on application routes. To return the request's Session call the `Get(ctx)` package-level function. Call `Handler()` once per sessions manager.

(requestOptions ...context.CookieOption)

Source from the content-addressed store, hash-verified

180//
181// Call `Handler()` once per sessions manager.
182func (s *Sessions) Handler(requestOptions ...context.CookieOption) context.Handler {
183 return func(ctx *context.Context) {
184 session := s.Start(ctx, requestOptions...) // this cookie's end-developer's custom options.
185
186 ctx.Values().Set(sessionContextKey, session)
187 ctx.Next()
188
189 s.provider.EndRequest(ctx, session)
190 }
191}
192
193// Get returns a *Session from the same request life cycle,
194// can be used inside a chain of handlers of a route.

Callers 3

TestSessionsFunction · 0.45

Calls 5

StartMethod · 0.95
NextMethod · 0.80
SetMethod · 0.65
EndRequestMethod · 0.65
ValuesMethod · 0.45

Tested by 3

TestSessionsFunction · 0.36