MCPcopy Create free account
hub / github.com/devfeel/dotweb / Session

Method Session

context.go:319–328  ·  view source on GitHub ↗

Session get session state in current context

()

Source from the content-addressed store, hash-verified

317
318// Session get session state in current context
319func (ctx *HttpContext) Session() (state *session.SessionState) {
320 if ctx.httpServer == nil {
321 panic("no effective http-server")
322 }
323 if !ctx.httpServer.SessionConfig().EnabledSession {
324 panic("http-server not enabled session")
325 }
326 state, _ = ctx.httpServer.sessionManager.GetSessionState(ctx.sessionID)
327 return state
328}
329
330// DestorySession delete all contents of the session and set the sessionId to empty
331func (ctx *HttpContext) DestorySession() error {

Callers 1

DestorySessionMethod · 0.95

Calls 2

SessionConfigMethod · 0.80
GetSessionStateMethod · 0.80

Tested by

no test coverage detected