title: Selenium addCookie getting Invalid Cookie Domain Exception even though I'm on the right domain
body: <p>So I'm trying to load previously saved cookies into my web driver with Selenium/Geb. First I goto the domain and then try to add the cookies. But the cookie domain and the url domain don't register with each other: </p>
  
  <pre><code>Caught: org.openqa.selenium.InvalidCookieDomainException: 
  You may only add cookies that would be visible to the current domain: .domain=.example.com =&gt; .www.example.com
  Build info: version: '2.35.0', revision: '8df0c6bedf70ff9f22c647788f9fe9c8d22210e2', time: '2013-0  8-17 12:46:41'
  System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.0-48-generic', java.version:   '1.6.0_27'
  Driver info: driver.version: unknown
  </code></pre>
  
  <p>It seems the cookie's domain is <code>.example.com</code> and the domain I get to when I go to <code>http://example.com</code> is <code>.www.example.com</code>. The only solution I can think of is overriding some method to spoof my current domain, but I have no idea how to go about that. </p>