bogdanfinn / tls-client

net/http.Client like HTTP Client with options to select specific client TLS Fingerprints to use for requests.
BSD 4-Clause "Original" or "Old" License
670 stars 134 forks source link

Cookies Automatically Setting #5

Closed MarvinMoore closed 1 year ago

MarvinMoore commented 1 year ago

When I'm making multiple request with the client, the cookies are automatically setting, and I'm not sure how to delete these auto set cookies. Also how to maintain cookie order if this is happening?

bogdanfinn commented 1 year ago

@tru681 This is happening via the CookieJar. Per Default the underlaying HTTP Client is using a cookie jar. That means that on every response the Set-Cookie header is evaluated and the cookies are stored in the Jar for the next requests. Next to the cookies you are Adding to the Jar manually by calling SetCookies

Is the cookie order really important? Never noticed that the cookie order is important for something

bogdanfinn commented 1 year ago

@MarvinMoore since 0.8.0 the cookie jar is optional. See examples how to use or not use cookie jar.