When I called the spring boot service I "manualy" added the cookie. I used the CookieService from ngx-cookie-service.
getNewKey() {
this.subs.add(this.clientService.getNewKey().subscribe(key => {
this.clients = key.clients;
if (key.cookie) {
var d: Date = new Date();
d.setMonth(d.getMonth() + 12);
this.cookieService.set(key.cookie.name, key.cookie.value, d);
}
})
);
}