Restrict cookies in the request header for the APIs

Discussão em 'Angular' iniciado por Suman Rana, Outubro 29, 2024.

  1. Suman Rana

    Suman Rana Guest

    I am developing an application with the following stack

    Frontend - Angular Backend - JAVA Springboot

    Both the applications are hosted on the same domain.

    When I am logging into my application, the cookies stored in the domain are getting sent to the request header. But, I am not explicitly sending any cookies to header.The browser is sending this cookies to the API. I have tried multiple ways to restrict the cookies from frontend code. But none of the solutions are working.

    Is there any way to restrict the cookies being sent in the request header from Angular ?

    I have tried multiple ways

    1. Restricting cookies using withCredential: false method in Angular HTTP Interceptor.
    2. Tried to restrict it with the service worker file.

    Continue reading...

Compartilhe esta Página