title: Same origin policy causes Ajax requests to example.com from www.example.com to be denied?
body: <p>If you visit a website at <a href="http://www.example.com/dir" rel="nofollow">http://www.example.com/dir</a> , then any ajax requests to <a href="http://example.com/dir/something.php" rel="nofollow">http://example.com/dir/something.php</a> (with the www missing) cause the following message to show up in google chrome's console:</p>
  
  <pre><code>XMLHttpRequest cannot load http://example.com/dir/something.php.
  Origin http://www.example.com is not allowed by Access-Control-Allow-Origin.
  </code></pre>
  
  <p>What's up with this, and what can be done to fix this?</p>
  
  <p>Edit: It seems that any cookies set by example.com also disappear when you visit www.example.com ?</p>