title: What is the right way to resolve token mismatch error in laravel?
body: <p>since I've updated laravel to 5.4 I constantly get: </p>
  
  <p><code>TokenMismatchException in VerifyCsrfToken.php line 68</code></p>
  
  <p>exception thrown. After some digging and reading through a whole lot of posts and github issues I've figured that my tokens aren't matching :). The point is that my laravel app sets the encrypted version of the token "XSRF-TOKEN" instead of its plain (X-CSRF-TOKEN) counterpart and the helper <code>csrf_token()</code> spits out the plain token hence mismatching tokens. Confusing though why documentation mentions X-XSRF-TOKEN when I get XSRF-TOKEN (missing X-) instead? So the questions are:</p>
  
  <ol>
  <li>Has the missing "X-" some meaning?</li>
  <li>How do I change the encrypted version of the token to the plain one? (regardless of the question #3)</li>
  <li>Should I even try to make a plain token out of the encrypted one or is it better to encrypt <code>csrf_token()</code> instead? (Does it even matter, since the connection is encrypted?)</li>
  <li>Is listing "XSRF-TOKEN" under <code>$excepted</code> in the <code>\MiddleWare\EncryptCookies.php</code> a viable option or could you suggest a better solution instead? (which sort of brings us back to the question #3)</li>
  </ol>
  
  <p>I'm sorry for so many questions and thanks in advance!</p>
  
  <h1>Edit</h1>
  
  <p>After rereading my questions several times I came to conclusion that they weren't clear enough and didn't complied with the title. My problem were the mismatching tokens and I thought having my doubts cleared would lead me to a solution, I thank @ThomasMoors for his patience and help. I will accept his answer, and although I've solved my problem a different way, it was his help that led me to the solution! I've additionally posted my own answer which describes how I've solved my issue to help others having similar issues!</p>