Edge browser not sending custom header after initial request, while Chrome works fine

Discussão em 'Angular' iniciado por Shahed Mahmoudi, Agosto 7, 2025.

  1. In my Angular + .NET Core application, I fetch a value called tenantId from the backend during the initial request. This tenantId is an encrypted string and it is generated based on the current date, so it changes daily. After receiving it, I store the value in sessionStorage, and then I use an Angular HTTP interceptor to add it to the headers of all subsequent API requests. This works perfectly in Chrome:

    • tenantId is stored and sent with all requests via the custom header.

    However, in Microsoft Edge, the first request works (I get the tenantId), but subsequent requests do not include the header, unless I manually clear the browser cache.

    What I've tried:


    • Confirmed that tenantId is correctly saved in sessionStorage


    • Added Cache-Control: no-cache and Pragma: no-cache headers to all API requests


    • Added a cache-busting query param like ?t=Date.now()


    • Made sure the interceptor is registered and works correctly in other browsers

    Question: Why does Edge fail to include the custom header (x-tenant-id) after the first request, while Chrome works fine?

    How can I ensure that Edge always sends the daily tenantId in every API request, without requiring users to manually clear the cache?

    Is this related to Service Workers, sessionStorage, or Edge-specific caching behavior?

    Any best practices or workarounds are appreciated.

    Continue reading...

Compartilhe esta Página