$cordovaFileTransfer not sending session cookie to server when using WkWebView



I was using UIWebView with Ionic1 ; all my requests to server (RubyOnRails using Devise) passed through the Devise authenticate_user! method without problem, and uploading files with $cordovaFileTransfer (also through authenticate_user!) was fine.

I switched to WkWebView on client side (using cordova-plugin-ionic-webview plugin).

All my requests to server are still fine (no problem with Devise authenticate_user! method) except uploads (still with $cordovaFileTransfer): Devise rejects any upload with a 401 error.

Some clue: although all my standard requests (logged on server side) include HTTP_COOKIE values (with a ‘_front_session’ value), permitting Devise to find my session back, all my upload requests are missing this HTTP_COOKIE param.

Using cordova-plugin-wkwebview-sync-cookies plugin didn’t help.

If this really is the cause of my problem, how can I get this _front_session cookie value on client side and add it to my header params when calling $cordovaFileTransfer.upload method ?