Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 13 beta WebKit breaks support for cookies

I've got a working Cordova based app, currently with relatively large user base. No problem so far except this one which Apple won't fix. It's OK though, we created ugly workarounds just to keep moving...

But, here comes iOS 13 (beta 8) and we learn that WebKit in this release doesn't send cookies back to server at all. Not once, not on the start - never. The release of iOS 13 is few weeks ahead and I simply don't know what are we to do when all users upgrade to it and our app stops working...

We use cookies for session management, nothing fancy, classical old Jetty based back end. The workaround I did for the first-time-use problem is to append jsessionid parameter to URL on each request and then strip that on server side, convert to cookie and send further down the chain. I don't know if it is safe to use it all the time assuming that WebKit stops sending back cookies. Here are some related bugs pending but it's unlikely Apple will even look at them:

  • https://bugs.webkit.org/show_bug.cgi?id=200857
  • https://forums.developer.apple.com/thread/121415

Anybody experiencing similar problems? How do you deal with it?

like image 260
Dima Avatar asked Aug 27 '19 11:08

Dima


2 Answers

I had the same problem with my ionic 3 app. I found workarounds using :

  • https://github.com/sneas/ionic-native-http-connection-backend

  • https://ionicframework.com/docs/native/http/#installation

By replacing the API calls from rxjs with the native objective C http call, the cookie persist well from the http response of the backend. Maybe, you can try with this ...

like image 114
Stéphane Maleyrie Avatar answered Nov 12 '22 01:11

Stéphane Maleyrie


Add this plugin https://github.com/oracle/cordova-plugin-wkwebview-file-xhr, it intercept XHR requests and handle them by this plugin. It works for me.

like image 26
Doctor.Who. Avatar answered Nov 12 '22 00:11

Doctor.Who.