Andre
Andre

Reputation: 145

Cordova app no longer sends cookies in its httprequests

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:

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.

Upvotes: 1

Views: 1619

Answers (1)

Andre
Andre

Reputation: 145

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.

Upvotes: 2

Related Questions