How to share cookies from my ios app to mobile saf

2019-05-11 11:49发布

I use asiHttpRequest library to do data get and post.

I have built a login function with it to login to my site, after that, if I launcher a URL from my app to use mobile safari app browse the site, it still remains not authenticated.

I guess the reason is that my app does not share the same cookie storage with safari, is that correct? is that possible I share the cookies with other apps, especially the Safari?

2条回答
smile是对你的礼貌
2楼-- · 2019-05-11 11:50

You can NOT share cookies in your App with Mobile Safari. As @erpayo said, it's in Sandbox.

Maybe add a UIWebView into your App is the best solution. Do not open an URL in Mobile Safari but open it in the UIWebView. It can get your cookies.

查看更多
爷的心禁止访问
3楼-- · 2019-05-11 12:06

no, it's not.

Cookies are sandboxed.

Maybe you can make some server side tracking using query string parameters, but it will become a security hole

查看更多
登录 后发表回答