Http POST stores unwanted cookies


#1

Hi there,

I have a problem with Ionic (@ionic/cli-utils: 1.10.2, ionic (Ionic CLI): 3.10.3). Here is the situation:

I’m making POST requests using the Http module (@angular/http) to an API using Django+DRF. Everything works well under ionic lab and also using cordova on a simulator (also on a real device) using the --livereaload flag.

But when I run the App WITHOUT the livereload flag, I noticed that every request (after adding the Authorization header to each request) comes with a special META variable called: “CSRF_COOKIE” (which gives me a 403 error).

How can I delete this after? or avoid storing it?

If I use the --livereload (or ionic lab/serve) this CSRF variable is not on the request.

If a go to Settings (on Android) and delete the App’s cached data, everything works again.

Once again, this only happens when I remove the --livereaload flag.

Thanks in advance.


#2

I tried the module “ngx-cookie-service” (https://github.com/7leads/ngx-cookie-service) without any luck.


#3

Also checked the “document.cookie” without any luck.


#4

More information:

  • The client (user agent) is the same when the --livereaload flag is set and when it is not.