5

Our client is using cookiebot on their sites and we faced an issue that is happening when the user chooses "Only Necessary" cookies. This problem occurs only when the "Only Necessary" option is selected, and is not happening if all cookies are accepted.

We have noticed that after "Only Necessary" cookies are accepted, the subscribe on Angular HttpClient get(), post() and other methods is never executed. This problem is solved if the page is reloaded.

Here is a code example:

this.http.get<string[]>('some/api/users', httpOptions)
.subscribe(res => {
  // It never gets here
  this.users = res;
});

I have created a simple PoC application that is demonstrating this behavior, which can be accessed here: https://cookiebot-poc.herokuapp.com/mobapp/

Working scenario:

  1. Clean cookies (or open incognito)
  2. Open https://cookiebot-poc.herokuapp.com/mobapp/
  3. Accept "all" cookies
  4. Click "Do Get" or "Do Post" button
  5. Request is sent, and list with users are displayed on screen

Issue reproduction scenario:

  1. Clean cookies (or open incognito)
  2. Open https://cookiebot-poc.herokuapp.com/mobapp/
  3. Accept "Necessary" cookies only
  4. Click "Do Get" or "Do Post" button
  5. Nothing happens

What is going wrong here?

Jesse
  • 3,522
  • 6
  • 25
  • 40
  • Is it an idea to open this as an issue on GitHub for Angular, or a support ticket with Cookiebot? Just to get more information directly from the people responsible – Jesse Sep 28 '22 at 14:59
  • 1
    The library you are using is overriding the "addEventListener" method. I found that there is a problem with it. As a workaround, you can refresh the page after the user chooses the cookie. For the actual solution, you should contact the relevant company. – Muhammet Can TONBUL Oct 04 '22 at 12:22
  • Thanks @MuhammetCanTONBUL , I've opened a support ticket with them to hopefully get some more information. – Jesse Oct 05 '22 at 14:04

0 Answers0