I have a rather strange issue with IE 11/Edge since I updated from Angular 8 to Angular 9, namely that session cookies are deleted after routing.
I can clearly see that the session cookie is set after a successful login. However, once the client goes to the next page, the session cookie is simply not present anymore.
In all other browsers (Firefox, Chrome, Safari, etc) the application works fine.
I use ngx-cookie-service@2.4.0 to set and get cookies using below code:
this.cookieService.set("token", output_portal.key);
this.cookieService.get("token");
Any help would be much appreciated!
Found the solution!! Never been this happy..
The ngx-cookie-service in Edge for some reason sets the path standard to /part-of-the-url which was in my case /login. Where I am pointing in the image used to say /login, now it says /.
Proper set cookie in Microsoft Edge
The following way of setting cookies solves the problem:
this.cookieService.set("token", output_portal.key, 30, "/");
30 is the amount of days the cookie is valid. Specify as long as you need it to be.