MCPcopy
hub / github.com/Place1/wg-access-server / ClearSession

Function ClearSession

pkg/authnz/authsession/session.go:47–55  ·  view source on GitHub ↗
(store sessions.Store, r *http.Request, w http.ResponseWriter)

Source from the content-addressed store, hash-verified

45}
46
47func ClearSession(store sessions.Store, r *http.Request, w http.ResponseWriter) error {
48 session, _ := store.Get(r, string(sessionKey))
49 session.Options.MaxAge = -1
50 if err := session.Save(r, w); err != nil {
51 logrus.Error(err)
52 return err
53 }
54 return nil
55}
56
57func SetIdentityCtx(parent context.Context, session *AuthSession) context.Context {
58 return context.WithValue(parent, sessionKey, session)

Callers 1

ClearSessionMethod · 0.92

Calls 2

GetMethod · 0.65
SaveMethod · 0.65

Tested by

no test coverage detected