From 24c31ac232985d14238e1e0ede5899bd1b598bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berk=20Alt=C4=B1ok?= <17373485+berkaltiok@users.noreply.github.com> Date: Wed, 5 Jul 2023 22:20:56 +0300 Subject: [PATCH] feat: add clear cookies function --- auth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auth.go b/auth.go index 8933f7f..b9e4aa2 100644 --- a/auth.go +++ b/auth.go @@ -383,6 +383,10 @@ func (s *Scraper) SetCookies(cookies []*http.Cookie) { s.client.Jar.SetCookies(twURL, cookies) } +func (s *Scraper) ClearCookies() { + s.client.Jar, _ = cookiejar.New(nil) +} + func (s *Scraper) sign(method string, ref *url.URL) string { m := make(map[string]string) m["oauth_consumer_key"] = appConsumerKey