you could use the Set Session Value behavior that is available in cookies toolkit and eCart to store the Product ID from the querystring on your product detail pages.
Set the set session value behavior to trigger before page load.
Then you could use that session to filter a recordset to last item viewed.