title: Laravel 5.4.3 session is not working on new request
body: <p>I am using jQuery Ajax function to validate user and create session. In laravel controller i have the following code.</p>
  
  <pre><code>        if( isset( $_POST['email'] ) )
          {
              $email      = $_POST['email'];
              $password   = $_POST['password'];
  
              $results =  DB::table('table')-&gt;where([
                              ['school_email', '=', $email ],
                              ['school_password', '=', $password],
                          ])-&gt;get() ;
  
              if( $results -&gt; count() ==  0 )
              {
                  echo json_encode( array('data' =&gt; '0' ) ); exit;
              }
              else
              {
                  $user =  $results[0] ;
                  session(['users' =&gt; $user ]);
                  $request    -&gt;  session()   -&gt;  put('two', 'test');
                  echo json_encode( array( 'data' =&gt; '1' ) );
                  exit;
      }
  </code></pre>
  
  <p>Session is set when i print it after setting session variable.But when i refresh the page or redirect user to another url. session is coming as empty variable.
  I am using file session with default settings and directory (storage) is writable. I did change server.php to index.php and copied htaccess from public directory to root just to access my local site with out writing public in url. e.g <a href="http://localhost/site2/login" rel="nofollow noreferrer">http://localhost/site2/login</a> before it was </p>
  
  <p><a href="http://localhost/site2/public/login" rel="nofollow noreferrer">http://localhost/site2/public/login</a></p>