title: Laravel 5.7 session flash message for login intermittently working
body: <p>I'm using Laravel 5.7 and have successfully sorted out login and logout for user using manual authentication.</p>
  <p>I have this in my login blade template to alert to bad credentials:</p>
  <pre><code>@if (Session::has('status'))
    &lt;div class=&quot;alert alert-danger text-center&quot; role=&quot;alert&quot;&gt;
      {!! Session::get('status') !!}
    &lt;/div&gt;
  @endif
  </code></pre>
  <p>This is in my controller, after determining that the username and password provided is not accepted:</p>
  <pre><code>$request-&gt;session()-&gt;flash('status', 'These credentials are not working.&lt;br&gt;Refresh and try again.');
    return redirect()-&gt;back()-&gt;withInput();
  </code></pre>
  <p>When it works, I get the status message and the username is provided. The thing I can't figure out is what happens next. I've tried all of the following and sometimes the message will display again, and sometimes it won't. It has never shown more than twice in a row. And once it doesn't show, it seems to not show for awhile.</p>
  <ul>
  <li>Enter in a different password (while username has already been inputted)</li>
  <li>Refresh browser, and try both again</li>
  <li>change username, and then enter password</li>
  </ul>
  <p>Even when I clear cookies, it does not seem to make any difference. I have double checked my cookie and session settings in .env and config files. I'm getting no error messages. I'm using database with mysql. I used migrate to build the sessions table.</p>
  <p>Sessions noted in the database are not inappropriately duplicating. The last activity field is updating appropriately.</p>
  <p>When I view the session cookie in Chrome, it's changing after every submission. I don't mean the XSRF-TOKEN, I mean the session cookie. I'm surprised it's changing.</p>
  <p>I'm thinking my code is okay but I have a setting wrong somewhere. Where should I look?</p>
  <p><strong>UPDATE:</strong> If I check &quot;Disable cache while DevTools is open&quot; then it works much better. I can submit bad credentials, and it will show the message and the username is in the field. If I enter the password and submit it redirects to a clean login, no message, no data.</p>
  <p>If I get the message and then manually refresh the browser to a new login, I will get the message again probably half of the time. But then I will attempt the same thing again (refresh, try again) and get multiple redirects to the login page again with no data/message.</p>
  <p><strong>Final Resolution:</strong>
  I changed session handling to <code>file</code>.</p>