Skip to content

Commit

Permalink
clear common cookies in ClearCookies
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Aug 20, 2023
1 parent 66c121d commit 08cabbc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1046,11 +1046,13 @@ func (c *Client) GetCookies(url string) ([]*http.Cookie, error) {
return c.httpClient.Jar.Cookies(u), nil
}

// ClearCookies clears all cookies if cookie is enabled.
// Note: It has no effect if you called SetCookieJar instead of
// SetCookieJarFactory.
// ClearCookies clears all cookies if cookie is enabled, including
// cookies from cookie jar and cookies set by SetCommonCookies.
// Note: The cookie jar will not be cleared if you called SetCookieJar
// instead of SetCookieJarFactory.
func (c *Client) ClearCookies() *Client {
c.initCookieJar()
c.Cookies = nil
return c
}

Expand Down

0 comments on commit 08cabbc

Please sign in to comment.