title: How do I resolve conflicting session cookies on specific subdomain?
body: <p>For starters, we're using the Yii framework to create our sites and it is handling the creation of the cookies.</p>
  
  <p>We have a site with many subdomains so the main site has a session cookieParams of ".sitename.com".</p>
  
  <p>Something like this:</p>
  
  <ul>
  <li>www.sitename.com</li>
  <li>a.sitename.com</li>
  <li>b.sitename.com</li>
  <li>admin.sitename.com</li>
  </ul>
  
  <p>We have <code>www</code>, <code>a</code>, and <code>b</code> to share the same session cookie and this works great. </p>
  
  <p>However, we have one special admin subdomain that has a different user system and login mechanism, so we have a separate session cookieParam of "admin.sitename.com".</p>
  
  <p>The problem is, if someone gets a session cookie from the main site, logging into the admin site fails, because the main site's ".sitename.com" cookie appears to be taking precedence. Deleting the cookie for the main site fixes the issue temporarily until the browser visits the main site again.</p>
  
  <p>Is there any way around this, or is there a better way to set the cookies domain?</p>
  
  <p>Thanks! </p>