@chrischerrett I could be wrong, just guessing here without looking at it... but obviously the XSRF will change on every request, that is the point of that token, to validate requests are secure for that single request. The session key is probably just "changing" because of encryption but is actually the same under the hood. This is the part I'm guessing about. Easy way to test your session is just drop the SESSION_LIFETIME to 1 in your .env and see if it expires. If not, something is up. If it does, probs just encryption making it look like it's changing.
XSRF-TOKEN and session key change with each request
Having implemented Authentication for my SPA using Sanctum successfully, I'm finding the http response to every request returns a new value for both the XSRF-TOKEN and the session key. This doesn't seem right. Am I correct to expect this value to remain the same with every response?
As a result, each request therefore sends a new value, and the session never seems to expire as a consequence. Can't work out what's going wrong?
Everything else is working as expected, as per the docs. Any clues?
'api' => [ \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 'throttle:180,1', \Illuminate\Routing\Middleware\SubstituteBindings::class, ],
Please or to participate in this conversation.