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

IOS10.2上的cookie设置,带入webview的时候有问题 #4

Open
codywch opened this issue Jan 6, 2017 · 2 comments
Open

IOS10.2上的cookie设置,带入webview的时候有问题 #4

codywch opened this issue Jan 6, 2017 · 2 comments

Comments

@codywch
Copy link

codywch commented Jan 6, 2017

在rn里头设置了然后请求我们的https的接口是正常的。但是在打开webview的时候,rn里已经成功设置的cookie并没有被带入webview中。导致一些问题。看网上说是10.2系统的一些问题。
image
希望作者有时间的话帮忙看下~谢谢

@xwenliang
Copy link
Member

只是iOS这样吧,截图里的cookie默认是httpOnly的这句话本身有问题,cookie是不是httpOnly完全看代码实现,有可能10.2这个系统是默认写入的httpOnly的类型,所以webview会取不到cookie,那么加上那句写入非httpOnly的代码可能就好使了。
在这句L22之前插入

[cookieProperties setValue:@"false" forKey:@"HttpOnly"];

试下吧,我现在暂时没空,xcode还没更新,你可以先试试😉

@codywch
Copy link
Author

codywch commented Jan 6, 2017

恩已经试过了,可以成功。但是不太清楚会不会影响到其他平台或系统版本。。。所以还加了个参数判断到底加不加这句(目前只在10.2加了这句)
不过不太会写原生的,可能处理的不太好。等你有空优化了这块我再更新下~~嘿嘿

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

No branches or pull requests

2 participants