Skip to content

FarhadG/cordova-wkwebview-cookies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WkWebView Cookies POC

A simple POC to showcase cookies support for WkWebView.

Getting Started

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

Problems

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.

  1. Custom Hostname: Add these values to the config.xml to set a custom hostname
<allow-navigation href="ionic:https://app/*" />
<allow-navigation href="http:https://app/*" />
<preference name="Hostname" value="app" />
  1. Custom Scheme: Add these values to the config.xml to set a custom scheme
<allow-navigation href="httpsionic:https://*"/>
<allow-navigation href="https://*"/>
<preference name="Scheme" value="https" />
<preference name="iosScheme" value="httpsionic" />
  1. 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).

About

A simple POC to showcase cookies support for WkWebView.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published