A simple POC to showcase cookies support for WkWebView.
For running node server (running on 3000):
$ npm install
$ node server.js
# Nodemon to start server with a watcher
$ nodemon server.js
For running Cordova:
$ npm install
$ cordova platform add ios
# emulator for iOS
$ npm run emulate:ios
# build for iOS
$ npm run build:ios
# build and start on connected iOS device
$ npm run start:ios
Current solution in this POC supports cookies with default hostname and scheme (ionic:https://localhost
), however, setting custom custom values provided in the cordova-plugin-ionic-webview documentation breaks cookies.
- Custom Hostname: Add these values to the
config.xml
to set a customhostname
<allow-navigation href="ionic:https://app/*" />
<allow-navigation href="http:https://app/*" />
<preference name="Hostname" value="app" />
- Custom Scheme: Add these values to the
config.xml
to set a customscheme
<allow-navigation href="httpsionic:https://*"/>
<allow-navigation href="https://*"/>
<preference name="Scheme" value="https" />
<preference name="iosScheme" value="httpsionic" />
- Although cookies work with default settings, they are never visible. That is, developers cannot inspect cookies inside of Safari's devtools (under application cookie storage).