0

I'm working on supporting login by Github OAuth. But I encounter a problem:

When I log in to the Github once, the subsequence OAuth requests will fail with the 302 HTTP status.

When the OAuth request failed, the HTTP request is as follow:

enter image description here

The HTTP response is as follow:

enter image description here

I know the 302 response is caused by the "user_session" in the HTTP request.

My question is that is there any way to disable the user_sesion in the HTTP request. I want to send a totally new HTTP request for each OAuth request.

Thanks!

MartinZ
  • 175
  • 2
  • 12

1 Answers1

0

I tried the solution at Disabling cookies in WKWebView. But it doesn't work for me.

After using myRequest.httpShouldHandleCookies = false

The WKWebView stops working. I guess it may be caused by the server cannot add cookies to our web browser.

The solution described at https://stackoverflow.com/a/31803708/10399490 works for me.

Just remove the cookies added by the Github.

I haven't verified whether the solution introduces any other side effects

MartinZ
  • 175
  • 2
  • 12