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

Method DestorySession

context.go:331–341  ·  view source on GitHub ↗

DestorySession delete all contents of the session and set the sessionId to empty

()

Source from the content-addressed store, hash-verified

329
330// DestorySession delete all contents of the session and set the sessionId to empty
331func (ctx *HttpContext) DestorySession() error {
332 if ctx.httpServer != nil {
333 ctx.Session().Clear()
334 if err := ctx.HttpServer().sessionManager.RemoveSessionState(ctx.SessionID()); err != nil {
335 return err
336 }
337 ctx.sessionID = ""
338 ctx.SetCookieValue(session.DefaultSessionCookieName, "", -1)
339 }
340 return nil
341}
342
343// Hijack make current connection to hijack mode
344func (ctx *HttpContext) Hijack() (*HijackConn, error) {

Callers

nothing calls this directly

Calls 6

SessionMethod · 0.95
HttpServerMethod · 0.95
SessionIDMethod · 0.95
SetCookieValueMethod · 0.95
RemoveSessionStateMethod · 0.80
ClearMethod · 0.65

Tested by

no test coverage detected