I have lately experienced problems with communication between the client-side front-end and the server-side back-end on the system I am developing at work.
My code has an Angular 7 front-end communicating with an ASP.NET MVC back-end over AJAX.
The back-end maintains state on the server side by storing BASE64-encoded data in the ASP.NET HttpContext which is supposed to be preserved across requests by reading the HttpContext items when receiving a request and updating them back into the HttpContext when sending a reply.
The problem was that sometimes, between subsequent calls from the Angular front-end, it appears that although the previous call wrote the state into the HttpContext all OK, the next call saw the HttpContext at its previous state, as it had been before the update.
Googling about the problem revealed this Stack OverFlow question about a similar issue. I tried the accepted answer written by user @Bharat about the provider APP_BASE_HREF and it seems to have worked, but I do not so far understand how.
I am curious about how exactly this works. What does the APP_BASE_HREF provider exactly do and how does it affect this case?