My add to cart url returns this. When i click it the products doesn't get added because it's invalid. This happens in the homepage.  

<pre>
http://localhost/mage/index.php/checkout/cart/add/uenc/aHR0cDovL2xvY2FsaG9zdC9tYWdlL2luZGV4LnBocC9wYWNrYWdlcy9wYWNrYWdlL2luZGV4Lw`,,`/product/13/form_key/D5FhQaqwv69PjG8q/
</pre>

First in my code it was using `$this->getAddToCartUrl($_product)` because of this issue i replaced it with this `Mage::helper('checkout/cart')->getAddUrl($_product)` Still the problem exists. 

If i clear my cache it works for a few hours and again it returns the incorrect url. How can i overcome this problem?

====update=========

Heard that this is a problem with new formkey introduced after magento 1.8. Any solution to overcome this issue?