Capacitor/Angular/Cookie on IOS App

i’ don’t know if i’m wrong completly but i have this idea.

I’m creating an app with capacitor to put into my IOS Device. This app needs of a login page, the server create a token and with this token i can show pages if user is authorized.

In my mind if i create a token and put it into a cookie (server side) i can save the cookie into my browser device and use it everywhere…unfortunatly this idea work, apparently, only on pc browser or android device but on ios the cookie not created.

I’m reading that this situation is about IOS devices because Safari doesn’t accept cookie from different domain. Is correct and i’m wasting time? Or there is a solution ?

I’m reading that is not a good idea save token into local storage or local session storage to a good security.

Someone can help me ?


Cookies are not recommended in a native mobile app - Capacitor iOS / Cookie Authentication / capacitor/http - #10 by dallas

See my post over here about storing an auth token - Best way to store Bearer token from API? - #2 by twestrick

Since my post, an open source secure storage Capacitor plugin has been created - GitHub - aparajita/capacitor-secure-storage: Secure, flexible storage for Capacitor apps using iOS Keychain and Android Keystore.. This is probably the best option outside of Ionic’s first party packages that require a subscription.

make sure that your server is configured to serve your app over HTTPS connection. This help to encrypt the connection between your server and app, prevent unauthorized access when transferring the data.