title: Why does Laravel create a new session after a GuzzleHttp POST request to the same subdomain?
body: <p>I'm trying to make a post request to the same subdomain with GuzzleHttp in a Laravel 5.1 installation, but as a response the login page is returned, showing that a new Session has been created in the request. The current session is not affected.</p>
  
  <p>Why does Laravel create a new session?</p>
  
  <p>In session.php I have the following values:</p>
  
  <pre><code>'driver' =&gt; env('SESSION_DRIVER', 'file'),
  'lifetime' =&gt; 120,
  'expire_on_close' =&gt; true,
  'files' =&gt; storage_path('framework/sessions'),
  'cookie' =&gt; 'admin_mydomain_com_session',
  'path' =&gt; '/',
  'domain' =&gt; 'admin.mydomain.com',
  'secure' =&gt; false
  </code></pre>
  
  <p>In my controller I use the following code to make the request:</p>
  
  <pre><code>// Create headers
  $headers = array(
      'X-CSRF-Token' =&gt; csrf_token()
  );
  
  // Create data
  $data = array(
      'param' =&gt; 'param',
      '_token' =&gt; csrf_token()
  );
  
  // Create a POST request
  $client = new Client();
  $res = $client-&gt;request('POST', 'http://admin.mydomain.com/my-url',
      array(
          'headers' =&gt; $headers,
          'form_params' =&gt; $data
      )
  );
  $statusCode = $res-&gt;getStatusCode();
  $body = $res-&gt;getBody();
  
  echo $body; // Shows me the login page
  </code></pre>