Cookie-based authentication for iOS for Ionic React / Capacitor

A quick update from my side.

I was under the impression that the plugin for native HTTP (https://github.com/capacitor-community/http) didn’t achieve the result I was looking for since the Developer Tools in Safari didn’t show any cookie set. However it turns out that when using the native HTTP plugin, the SetCookie directive causes the cookie to be created and stored, and sent by iOS in subsequent requests to the backend. So using the native HTTP plugin solves the issue we ran into.

We ran into some other issues when trying to use the HTTP plugin for web (non-native) calls, e.g. when trying to pass some security related info to the backend. What we do now is to use Axios for non-native HTTP calls and the HTTP plugin for the same backend calls, but then from native iOS platforms.

Ronald

4 Likes