WKWebView can't carry cookie for 302 redirect

后端 未结 2 690
谎友^
谎友^ 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?

提交回复
热议问题