This is probably because you are starting with viewing the site with the "www." before the domain name and then it returns you to the site without it or vice versa.
From a session and cart perspective the www. and domain only version of the site have completely separate data. The solution is usually to add an .htaccess rule to force people to always view the site either with or without the "www." in the url and then make sure you are referring to it correctly in the paypal settings on the confirm.php page.