0

Angular 16

Ionic 7

ngx-cookie-service 16

With this.cookieService.set('sessionkey', 'a-unique-hash', null, null, null, false, 'Lax'); or this.cookieService.set('sessionkey', 'a-unique-hash'); i set a cookie. In my browser tools can i see the cookie for the domain. But no cookie is send with request to the server.

I expect that the cookies can be seen in the browser tools under "Network" in the request (cookies send with the request).

[edit]

All requests has withCredentials: true:

req = req.clone({
  url: this.apiBaseUrl + req.url,
  withCredentials: true,
});

[edit]

If I don't clone the request with an object as a parameter, the url is wrong but the cookies are sent.

...the clone() function make the shit. Why?

Torsten
  • 1
  • 1

1 Answers1

0

Only Google Chrome does not send the cookies. I tested it several times.

Google Chrome Version 114.0.5735.106 (Offizieller Build) (64-Bit)

With Firefox, the cookies are sent without any problems.

...both on Xubuntu 22.04.2 LTS - 5.19.0-43-generic.

[edit]

Google Chrome now in Version 114.0.5735.198 and the problem is still there. In Firefox is all OK.

[edit] It also doesn't work in the current Opera (100.0.4815.21) browser.

Torsten
  • 1
  • 1
  • you should rather update the question with the information, than writing it as a comment – Yone Jun 12 '23 at 18:26
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 12 '23 at 18:27