'Firefox CSRF token issue on the request

Sometimes happen that randomly and only in Firefox my endpoint fails because the XSRF-TOKEN doesn’t match the request XSRF-TOKEN Cookie due to the fact that the Set-Cookie response header isn’t being updated properly or isn’t aligned at a certain point in the execution.

for example this http request fails because the values are different.

enter image description here

In chrome instead, the values are different but the request send the same value

enter image description here

Do you have any idea about it?, the FE part is writtend with Angular and the BE with JAVA

thanks in advance Andrea



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source