title: How to use Auth::check or Auth::user between different domains?
body: <p>I've got a question regarding Laravel framework (vers. 5.2) and the authentication. I have 2 domains which represent a software. let's call them <code>https://azure.mydomain.com</code> and <code>https://azuresoftware.mydomain.com</code>.</p>
  <p>The Laravel application is hosted on the domain <code>https://azuresoftware.mydomain.com</code>. <code>https://azure.mydomain.com</code> is just a CMS framework which is providing some information about the website.</p>
  <p>Now I want to display different menus, if the user is logged in or not on <code>https://azure.mydomain.com</code>. I thought, I can do a <code>fetch</code> request to <code>https://azuresoftware.mydomain.com/</code> and use the Laravel methods <code>Auth::check()</code> to check if the user is already logged in or not. I know that this is a CORS fetch request, but this is not the issue. I've allowed in the IIS webserver requests from <code>https://azure.mydomain.com</code>. The request works fine and also just a simple request. But actually <code>Auth::check()</code> is always returning <code>false</code>, even when I'm logged in on the software side.</p>
  <p>This is my code so far:</p>
  <pre><code>&lt;script&gt;
      fetch('https://azuresoftware.mydomain.com/checkLogin', {
          method: 'GET', 
          headers: { 
              'Content-Type': 'text/plain'
          }
      })
      .then(function(res) { 
          return res.json()
      })
      .then(function(data) { 
          if(data.isLoggedIn) {
              // do some stuff...
          }
          else 
          {
              // do some other stuff...   
          }
      });
  &lt;/script&gt;
  </code></pre>
  <p><strong>routes.php:</strong></p>
  <pre><code>Route::group(['middleware' =&gt; 'web'], function () {
  ...
      Route::get('checkLogin', function() {
          return json_encode(['isLoggedIn'=&gt;\Auth::check()]);
      });
  ...
  </code></pre>
  <p>I'm sure, I forgot something essential, why it is not working this way.</p>