title: Laravel automatic log in when redirect to subdomain
body: <p>I have 2 subdomains with different databases but some users are listed in both database. These users have the right to switch to another subdomain, but when they want to switch to the other, they have to log in again. I want them to be able to switch without logging in, how could I do that? I've already found some information about this but it didn't help unfortunately</p>
  <p>I try this:</p>
  <p><strong>Controller:</strong></p>
  <pre><code>function change_database(Request $request){
      $email=Auth::user()-&gt;email;
      $password=Auth::user()-&gt;password;
      return Redirect::to($request-&gt;selected_database)-&gt;with([
          'email' =&gt; $email,
          'password' =&gt; $password
      ]);
  }
  </code></pre>
  <p><strong>web.php:</strong></p>
  <pre><code>Route::get('/', function () {
      if(isset($email) &amp;&amp; isset($password)){
          Auth::attempt(['email' =&gt; $email, 'password' =&gt; $password]);
      }
      return view('auth.login');
  });
  
  
  </code></pre>