http response tooling written
This commit is contained in:
@@ -2,10 +2,10 @@ package site
|
||||
|
||||
import "net/http"
|
||||
|
||||
func deleteCookieInResponse(w http.ResponseWriter, name string) {
|
||||
w.Header().Set("Set-Cookie", (&http.Cookie{
|
||||
func getExpiredCookie(name string) http.Cookie {
|
||||
return http.Cookie{
|
||||
Name: name,
|
||||
Path: "/",
|
||||
MaxAge: -1, // expire the cookie
|
||||
}).String())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user