If you always display the cart after you add to cart then I'd just always save with any visit to the cart page. For mobile you may have to also save the cart contents in the database on the eCart_JSON.php page.
Then probably add an include to the template that checks if this is the first visit to the site (if a session variable "CartPopulated" doesn't exist) and have it populate the cart from the database and then set the session variable so it only happens once.