After further investigation, it turns out that the token returned from the session often becomes regenerated. I don't know why. Is Google Chrome doing something stupid?
vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\VerifyCsrToken.php:79
public function handle($request, Closure $next)
{
dump($request->input('_token'));
dump($request->header('X-CSRF-TOKEN'));
dd($request->session()->token());
if ($this->isReading($request) || $this->shouldPassThrough($request) || $this->tokensMatch($request)) {
return $this->addCookieToResponse($request, $next($request));
}
throw new TokenMismatchException;
}
Result:
"7MT0g2SwgejS2alE6xDoTqA1ZnT6FFbSIcaCawuS"
null
"NJhVgyUQxu82nOgkkBSzio8b7R8GM7pZJoYFnG5k"
The weird thing is how the correct token eventually comes back (Usually after 3-5 refreshes)
