I'm trying to learn how to use Laravel Sanctum authentication. When I send GET https://localhost/sanctum/csrf-cookie
I get the following CSRF cookies:
XSRF-TOKEN=eyJpdiI6Inhvb0FDVXdHZDU5QzBqQTNKaWNxTUE9PSIsInZhbHVlIjoiSXNudjNiNE9xbmtNVWdsQ0l2SDRyYUNPQXIrTGJLb2ZMVDc2NWttenZGY0NkcDRvQzFVQlZOMDRlNFdTOHJaNiIsIm1hYyI6ImY0Y2M2YzZiZWIxYWVmZTRmMWI5NWRhNTBhN2JmM2VjNGExYjU0MGYwYWVmYTE4ODQxM2I0YTFlMWVjZTVhMDkifQ%3D%3D;
You can notice the strange %3D%3D at the end of the token. These characters also added for my laravel_session cookie. When I then send back a request with this exact token in the header X-XSRF-TOKEN, I'm getting token mismatch error. When I remove the characters - all works. I wonder where's these characters came from and how can I remove them.
UPD: since those were encoded URL characters, when I decoded them and put '==' instead at the end of X-XSRF-TOKEN, that seems to be working. Still, it's strange why it worked before when I just removed the characters from the query manually.