Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vincent15000's avatar

Cookies / token in the browser with Laravel / Sanctum / VueJS / Axios

Hello,

I try to understand how it works with the cookies in the browser.

I have opened the devtools in the browser and I have displayed the cookies.

When I log in from VueJS with the login API call, I notice that the cookies (laravel_session, XSRF-TOKEN, and a strange cookie named ksGFhsdl3kjfhg5dkjJsgh (some random letters which change at each new login) change 2 to 4 times each time I log in.

First question : is it normal ? Second question : if it is normal, why do they change 2 to 4 times ? Thirst question : when I log out, the cookies are not deleted, they are only changed, is it normal ?

I have tried to delete them handling the cookie in JS, but I can only retrieve the XSRF-TOKEN cookie and furthermore when I remove it, it isn't deleted.

Can you please help me to understand better for the 3 questions ?

Thanks a lot ;).

Vincent

0 likes
0 replies

Please or to participate in this conversation.