WKWebView cannot carry cookie for redirect 302

I set a cookie in the request header before calling the loadRequest () function to load the page. I also use document.cookie () to set cookies using WKUserScript in accordance with [ WKWebView Cookies . However, I believe that if a 302 redirection occurs, the request may fail to lose the cookie. For example, the request http: // A is redirected to http: // B , I can set the cookie for the request http: // A using the request header and use WKUserScript, but these two methods cannot set the cookie for the request http: // B therefore, request 302 http: // B may fail. This situation is observed in ios8 more often than ios9. Does anyone have a workaround?

0
source share
1 answer

Note, but probably the first answer may contain the "Set-Cookie" header. Therefore, you must use the provided cookie in the second request. Maybe he is absent.

0
source

All Articles