Python-Tls-Client icon indicating copy to clipboard operation
Python-Tls-Client copied to clipboard

cookies not extracted in autoRedirect requests !!!

Open taoshiyu opened this issue 1 year ago • 4 comments

200 status request: request----cookie_extracted--->response 302 status request: request-----cookie_not_extract---->requests-----cookie_extracted---->response

only the last response headers set-cookies is extracted,the set-cookies in the redirected response headers ignored 302 redirect always happen in web login ,all the cookie must be extract

taoshiyu avatar Apr 28 '24 03:04 taoshiyu

Can confirm. Very annoying!

OculusVisionSellix avatar May 29 '24 17:05 OculusVisionSellix

can do like this,stupid but work

  response = session.get(url, allow_redirects=False)
  while redirect_location := response.headers.get('Location'):
      response = session.get(redirect_location)

taoshiyu avatar May 30 '24 02:05 taoshiyu

can do like this,stupid but work

  response = session.get(url, allow_redirects=False)
  while redirect_location := response.headers.get('Location'):
      response = session.get(redirect_location)

Yeah, that's possible, but still very ugly.

I just looked in the library and it looks like it has to do with the implementation, since the auto-redirects are handled by the Golang-Tls-Client and after the requests only the cookies from the last request being added to the session...

Maybe somebody is able to do a Pull Request, not sure tho...

OculusVisionSellix avatar Jun 01 '24 13:06 OculusVisionSellix

any fix here possible?

pressplay01 avatar Aug 18 '24 14:08 pressplay01