WKWebView can't carry cookie for 302 redirect

后端 未结 2 688
谎友^
谎友^ 2021-01-06 18:43

I set cookie in request header before I call loadRequest() function to load a page. I also use document.cookie() to set cookie by WKUserScript according to [WKWebView Cookie

相关标签:
2条回答
  • 2021-01-06 19:09

    workaround for set cookies in iOS please check my answer. You must set cookies both in request and wkuserscript same time. otherwise it fail one time and sucess in 2nd run,

    Can I set the cookies to be used by a WKWebView?

    0 讨论(0)
  • 2021-01-06 19:27

    Note sure, but probably the first response may contain "Set-Cookie" header. Hence, you have to use the provided cookie in the second request. May be it's missing.

    0 讨论(0)
提交回复
热议问题