aboutsummaryrefslogtreecommitdiffstats
path: root/src/kube2msb/vendor/github.com/coreos/pkg/httputil/cookie.go
blob: c37a37bb27c750c3d1b61305a127c3b5d853e856 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package httputil

import (
	"net/http"
	"time"
)

// DeleteCookies effectively deletes all named cookies
// by wiping all data and setting to expire immediately.
func DeleteCookies(w http.ResponseWriter, cookieNames ...string) {
	for _, n := range cookieNames {
		c := &http.Cookie{
			Name:    n,
			Value:   "",
			Path:    "/",
			MaxAge:  -1,
			Expires: time.Time{},
		}
		http.SetCookie(w, c)
	}
}