I suspect your server has a problem with session management.
use the session test page from this post to test:
showpost.php?p=23826&postcount=2
Instead of using UNION All in the recordset, you will need to create a separate recordset for each product table and a separate add to cart button behavior.