Skip to content

Commit

Permalink
Improve documentation about DelClientCookie which related with #951. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyonlin authored Jan 27, 2021
1 parent b4b40e9 commit 5661df8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions header.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,16 @@ func (h *RequestHeader) SetCookieBytesKV(key, value []byte) {
}

// DelClientCookie instructs the client to remove the given cookie.
// This doesn't work for a cookie with specific domain or path,
// you should delete it manually like:
//
// c := AcquireCookie()
// c.SetKey(key)
// c.SetDomain("example.com")
// c.SetPath("/path")
// c.SetExpire(CookieExpireDelete)
// h.SetCookie(c)
// ReleaseCookie(c)
//
// Use DelCookie if you want just removing the cookie from response header.
func (h *ResponseHeader) DelClientCookie(key string) {
Expand All @@ -1029,6 +1039,16 @@ func (h *ResponseHeader) DelClientCookie(key string) {
}

// DelClientCookieBytes instructs the client to remove the given cookie.
// This doesn't work for a cookie with specific domain or path,
// you should delete it manually like:
//
// c := AcquireCookie()
// c.SetKey(key)
// c.SetDomain("example.com")
// c.SetPath("/path")
// c.SetExpire(CookieExpireDelete)
// h.SetCookie(c)
// ReleaseCookie(c)
//
// Use DelCookieBytes if you want just removing the cookie from response header.
func (h *ResponseHeader) DelClientCookieBytes(key []byte) {
Expand Down

0 comments on commit 5661df8

Please sign in to comment.