That is how the browser works. You will need to implement some way to refresh the token yourself. So for instance when the tab is opened, you send an ajax request to the backend to get a new csrf token. Or reload the page.
Feb 7, 2023
3
Level 8
CSRF token mismatch after login.
Hello, I have this error message : CSRF token mismatch
this Error is produced if I :
- open two tabs A and B
- when the session is expired on both tabs and I logged-in on the tab B
- then I try to use Axios (post or get) on the tab A, it produces CSRF token mismatch
Any Idea please?
Please or to participate in this conversation.