title: Using same cookie across selective subdomains
body: <p>I have been trying to find out a way to share cookies across multiple subdomains.</p>
  
  <p>Setting the cookie like:</p>
  
  <pre><code>setcookie('token', base64_encode(serialize($token)), time()+10800, '/', '.mydomain.com');
  </code></pre>
  
  <p>does exactly that. But there is a slight problem here.
  This will share the cookie across all subdomains.</p>
  
  <p>My problem is that I have other environments (Dev and test) set up on 2 subdomains.
  I am looking for a way to share cookies across "Selective" subdomains. i.e. share across some subdomains, and not share amongst others. I am not sure if anything like this exists.</p>
  
  <p>Any help is appreciated.
  Thanks.</p>