title: Laravel 5.4 TokenMismatchException in VerifyCsrfToken.php line 68
body: <p>When I login for the first time it works perfectly but when I log out from my app and try to re-login I get this error.</p>
  
  <p>I've tried almost every available solutions but can't solve the issue. Any solution to fix this error? </p>
  
  <p>This is how I perform login and logout(Please correct me if the code is wrong as I'm new in laravel).</p>
  
  <p>I've tried laravel-caffeine and {{ csrf_token() }}.</p>
  
  <p>I think this is some session related issue.</p>
  
  <pre><code>public function auth(Request $request)
  {
      $this-&gt;validate($request, [
          'email' =&gt; 'required|email|max:255',
          'password' =&gt; 'required|min:6',
      ]);
  
      $data = $request-&gt;only('email', 'password');
  
      if (\Auth::attempt($data)) {
          $email = $request-&gt;email;
           $users = DB::table('users')
              -&gt;where('email', $email)
              -&gt;select('users.*', 'user_name')
              -&gt;get();
  
          Session::put('set', $users);
  
          if ($users[0]-&gt;is_admin == '1') {
              return redirect()-&gt;intended('adminDashboard');
          }else{
              return redirect()-&gt;intended('dashboard');
          }
      }else{
          return back()-&gt;withInput()-&gt;witherrors(['Email or password did not match!']);
      }
  }
  
  public function logout(){
      Session::flush();
      return view('login/login');
  }
  </code></pre>