title: Symfony multi domain login
body: <p>So, I have my symfony 4 website, using multi domain.
  It's not different websites, it's one website, with different languages, so I have example.com, en.example.com, ...
  If we log on example.com, it works, but it doesn't make the user logged in on en.example.com.
  I tried to set the config as I've seen in framework.yml:</p>
  
  <pre><code>framework:
      session:
          handler_id: ~
          cookie_domain: '.localhost'
          name: SFSESSION
  </code></pre>
  
  <p>But it simply breaks the login (there's no error but it 'triggers' a fail login, and no cookie is set.
  If I set 'en.localhost' as a domain, it works for that subdomain, but no others obviously.</p>
  
  <p>I made a test page with that code:</p>
  
  <pre><code>&lt;?php
  
  $currentCookieParams = session_get_cookie_params();
  
  $rootDomain = '.localhost';
  
  session_set_cookie_params(
      $currentCookieParams["lifetime"],
      $currentCookieParams["path"],
      $rootDomain,
      $currentCookieParams["secure"],
      $currentCookieParams["httponly"]
  );
  session_start();
  </code></pre>
  
  <p>The result is that when I access localhost, I have a php cookie (on my symfony app, a similar config leads to no cookie), but if I go to test.localhost, I have nothing.</p>
  
  <p>I tried to install the apache pack ( <a href="https://symfony.com/doc/current/setup/web_server_configuration.html" rel="nofollow noreferrer">https://symfony.com/doc/current/setup/web_server_configuration.html</a> )
  And to set </p>
  
  <pre><code>php_value session.cookie_domain ".localhost"
  </code></pre>
  
  <p>In the .htaccess, and it doesn't work, I login on subdomain and nowhere else; it's like the htaccess is ignored.</p>
  
  <p>What am I missing ?
  Thank you</p>