title: Codeigniter Set a Cookie without a leading '.' on domain value
body: <p>I'm trying to integrate a new Codeigniter powered login area into a legacy (3rd party) PHP site hosted on a subdomain. </p>
  
  <p>When I set a cookie named 'logged_in' in the CI area (intended to be used by both the CI section and the rest of the site), Codeigniter always adds a leading '.' to the <em>domain</em> value.</p>
  
  <p>The problem being that the legacy site sets and deletes it's cookies for the domain '<em>dev.example.co.uk</em>'. The problem manifests itself upon logout via the legacy site, when it doesn't destroy the 'logged_in' cookie (presumably because it's set at a different domain).</p>
  
  <p>I've tried changing the CI config settings from the default blank:</p>
  
  <pre><code>$config['cookie_domain']    = "";
  </code></pre>
  
  <p>to the actual domain:</p>
  
  <pre><code>$config['cookie_domain']    = "dev.example.co.uk";
  </code></pre>
  
  <p>or by explicitly setting it on creation with:</p>
  
  <pre><code>$this-&gt;input-&gt;set_cookie('logged_in', 'true', '86500', 'dev.example.co.uk');
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>$this-&gt;input-&gt;set_cookie('logged_in', 'true', '86500');
  </code></pre>
  
  <p>But whenever I inspect the cookie in Chrome the Domain value always shows as '.dev.example.co.uk'.</p>
  
  <p>I realise CI is adding the '.' for maximum compatibility with older browsers, (as stated <a href="http://www.php.net/manual/en/function.setcookie.php" rel="nofollow">here at php.net/manual</a>) but for this specific (albeit unusual) scenario I need it without.</p>
  
  <p>Does anyone know of a way to prevent CI from adding the leading '.' to the domain?</p>