开发者

How does Safari manage its cookies?

开发者 https://www.devze.com 2023-02-14 06:52 出处:网络
I recently realised that Safari in iOS manages cookie separately for Safari.app and other apps that embed UIWebViews. I concluded so because I developed browser based app and saw the following behavio

I recently realised that Safari in iOS manages cookie separately for Safari.app and other apps that embed UIWebViews. I concluded so because I developed browser based app and saw the following behaviour:

开发者_开发百科
  • login to web service which then sets session id to cookie.
  • when I go to safari app and access the web service, I was asked to log in again.

Is it true that Safari in iOS manages cookie separately for safari app and other browser based app?


Yes, you are correct.

Every app is sandboxed, meaning is has no access to any other app (which Mobile Safari is).

Thus, cookies set in a browser-based app will not affect the Mobile Safari app.

See this question for a possible workaround (kinda): Setting a cookie in an iPhone App


It looks like you are trying to track your mobile app installations. I would recommend checking out yoz.io because they are free and do not require an sdk.

Enjoy ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消