MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / DeleteSession

Function DeleteSession

internal/cookie/cookie.go:71–76  ·  view source on GitHub ↗

DeleteSession sets session cookies to expire.

(gc *gin.Context, appCookieSecure bool, sameSite http.SameSite)

Source from the content-addressed store, hash-verified

69
70// DeleteSession sets session cookies to expire.
71func DeleteSession(gc *gin.Context, appCookieSecure bool, sameSite http.SameSite) {
72 for _, c := range BuildDeleteSessionCookies(parsers.GetHost(gc), appCookieSecure, sameSite) {
73 gc.SetSameSite(c.SameSite)
74 gc.SetCookie(c.Name, c.Value, c.MaxAge, c.Path, c.Domain, c.Secure, c.HttpOnly)
75 }
76}
77
78// BuildDeleteSessionCookies returns the pair of zero-value, expired session
79// cookies that cause browsers to delete the host-scoped and domain-scoped

Callers 1

LogoutHandlerMethod · 0.92

Calls 2

GetHostFunction · 0.92

Tested by

no test coverage detected