1

I have an Ionic (Cordova/Angular) app that I have running on an Android phone (Galaxy S6 Edge, Android 5.1.1). This app communicates with a server for which the user must login first.

After login, authentication cookies received from the server are automatically send back to the server on each request by including withCredentials=true inside $http calls.

For instance:

$http({
                method: 'POST',
                url: LoginStatusUrlMobile,
                responseType: 'document',
                withCredentials: true
            })

This used to work, but this weekend the cookies were no longer sent and the app no longer works. I tried several things to figure out what is going on:

  • Is it the new release of Chrome 46? => I uninstalled the updates of Chrome and the Chrome webview on my Phone but this didn't make any difference

  • In my development environment the app still works (Chrome version 46.0.2490.71 on Mac with --disable-web-security to turn of same origin policy)

  • I tried to run the app inside Genymotion and this worked on a virtual device running Android 4.4.4 but it didn't send the cookies on a virtual device running Android 5.1.0

  • The app also runs on iOS, and I haven't tested that thoroughly yet but it works OK on my iPad with iOS 8.1

This is my situation right now and my question is: does anyone know how to send cookies back to the server with angular $http requests, when withCredentials=true no longer seems to work.

Andre
  • 145
  • 1
  • 11

1 Answers1

2

I found a solution by removing the Android platform and then recreating it. After that I added the cordova-whitelist-plugin as stated here.

Now everything is working properly again.

Community
  • 1
  • 1
Andre
  • 145
  • 1
  • 11