Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cookies not extracted in autoRedirect requests !!! #120

Open
taoshiyu opened this issue Apr 28, 2024 · 4 comments
Open

cookies not extracted in autoRedirect requests !!! #120

taoshiyu opened this issue Apr 28, 2024 · 4 comments

Comments

@taoshiyu
Copy link

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

@OculusVisionSellix
Copy link

Can confirm.
Very annoying!

@taoshiyu
Copy link
Author

taoshiyu commented May 30, 2024

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)

@OculusVisionSellix
Copy link

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...

@pressplay01
Copy link

any fix here possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants