title: How to solve Laravel not generating CSRF token
body: <p>Okay, so I've been using jQuery to connect to a controller function that authenticates data and submits it via AJAX using <a href="https://codingdriver.com/ajax-post-request-laravel-example.html" rel="nofollow noreferrer">this code</a>. This was working flawlessly until I took a day off on Saturday. Coming back to the project yesterday I keep encountering this error with HTTP code 419</p>
  <pre><code>&quot;message&quot;: &quot;CSRF token mismatch.&quot;,
  &quot;exception&quot;: &quot;Symfony\\Component\\HttpKernel\\Exception\\HttpException&quot;,
  &quot;file&quot;: &quot;C:\\workspace\\app_name\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Exceptions\\Handler.php&quot;,
  &quot;line&quot;: 387,
  </code></pre>
  <p>So I tried to echo the CSRF token and it's blank! Keep in mind it was working perfectly Friday then come Sunday (yesterday), with no external input, it just randomly hits me with this. What could be the reason for it not generating a token?</p>