Cookies have been playing an important role in the iOS world for a long time. They transfer and store stateful information in the app. This article describes the approach to sharing the login session across the native iOS app and the embedded webpage by setting the cookie to WKWebView.
The ability to share authorization between a native iOS app and an embedded webpage is in high demand. Users only need to login once to the app and are able to access the web without the need to input the username and password again. The great convenience brought to users by utilizing the advantage of cookies is super-exciting.
HTTPCookie
contains the attributes of the cookie. It is defined by a key-value pairs dictionary which uses HTTPCookiePropertyKey
as the key.
#mobile #javascript #swift #ios