BuildDeleteAdminCookie returns a zero-value, expired admin cookie that causes browsers to delete the admin session cookie. Transport-agnostic mirror of DeleteAdminCookie.
(hostname string, adminCookieSecure bool)
| 62 | // browsers to delete the admin session cookie. Transport-agnostic mirror of |
| 63 | // DeleteAdminCookie. |
| 64 | func BuildDeleteAdminCookie(hostname string, adminCookieSecure bool) *http.Cookie { |
| 65 | host, _ := parsers.GetHostParts(hostname) |
| 66 | return &http.Cookie{ |
| 67 | Name: constants.AdminCookieName, |
| 68 | Value: "", |
| 69 | MaxAge: -1, |
| 70 | Path: "/", |
| 71 | Domain: host, |
| 72 | Secure: adminCookieSecure, |
| 73 | HttpOnly: true, |
| 74 | SameSite: http.SameSiteStrictMode, |
| 75 | } |
| 76 | } |
no test coverage detected