Try put this line before the first pageview:
_gaq.push(['_setDomainName', 'none']);
Your tracker will be similar this:
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12345-1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_trackPageview']);
</script>
This option works directly with the cookie configuration, so use only for locahost!